sump up of setting up amp-jekyll in my project - plugins

I am working on a jekyll project and already asked some questions on stackoverflow and jekyll talks site. This post is a sump up for the issue I have about setting up amp-jekyll. amp-Jekyll is a jekyll plugin. The full documentation is at this adress : https://github.com/juusaw/amp-jekyll
The tree of my project is the following
My Version of jekyll is jekyll-3.6.2
I installed the plugin using the Gemfile (gem "amp-jekyll", "1.0.2" # installed). I checked that the plugin is well installed.
Then I followed the documentation:
1) I Placed the layout file (amp.html at https://github.com/juusaw/amp-jekyll/blob/master/amp.html) to the _layouts folder. I have a first question about that. I looked at this file and don't know how to use it. Have I just to copy it in the _layouts folder and that's all or have I to take a part of it and copy it to another file (and if so where ?). I can see in the body part the use of {{ header | amp_images }} or {{ footer | amp_images: false, 24, 24 }}. What does that mean ? . And what about the part included in head tag ?
2) Then, I Added amphtml-link to post heads (Add CSS styles to the html template). In my case I just copy the following code
{% if page.path contains '_posts' %}
<link rel="amphtml" href="https://localhost::4000/inger/toto.html">
{% endif %}
with a faked href url in my footer.html file (https://github.com/flamant/fileshare/blob/master/footer.html).. I have a second question about this snippet of code. What is this link ? and is it taken into consideration if this page a post ?
3) And I run bundle exec jekyll serve
The first page witch is published is index.html. the code is
---
layout: default
title: Hank Quinlan, Horrible Cop
lang: fr
---
<div class="blurb">
<h1>This is content</h1>
</div>
The default.html file (in _layouts folder) is the following
<!DOCTYPE html>
{% include header.html %}
{{ content }}
{% include footer.html %}
And the header.html is at the following location : https://github.com/flamant/fileshare/blob/master/header.html
The first images that I display (and that I can't see) are in this file.
So my main question is : Why I can't see the images ?

finally I found what was going wrong : the attribute should be src instead of scr. I am confused about asking this question.

Related

Adding class attribute to HTML Tag in TYPO3 9.x or access the config.yaml configuration in typoscript?

In my TYPO3 9.5 LTS project i want the follwoing HTML Tag rendered:
<html dir="ltr" lang="de" class="no-js">
In previous TYPO3 Settings, i could configure this by the typoscript:
page.config.htmlTag_setParams = dir="ltr" lang="{$config.language}" class="no-js"
But in TYPO3 9.5, the language settings are defined in the config.yaml file. Without the typoscript setting above, the html tag will render the correct dir attribute and lang attributt. But if i try to add the class attribute like this:
page.config.htmlTag_setParams = class="no-js"
the lang and dir attribute will be overwritten.
Is there a way to just add the class attribute without removing the lang and dir attribute?
Can i access the yaml configurations in typoscript setup?
This will be possible as soon as 9.5.2 has been released because of the feature https://review.typo3.org/#/c/58976/

bootstrap_3_layout.html.twig in Symfony3

How can I install "bootstrap_3_layout.html.twig,... for my project on 3 version Symfony?
When I copy these files to my project I get error:
'Unexpected character "&"' (Twig_Error_Syntax).
Don't copy or past these files, but instead configure the TwigBundle to use them as form templates, make this configuration in your config.yml file
twig:
form_themes:
- bootstrap_3_layout.html.twig
Make sure that bootstrap is used in your application
Use this
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
Or download it and use it in your application

How to add bower component to gulp app

I am not sure the title is correct but i am new with Bower, Gulp, Strongloop and even AngularJS.
I am updating an existing app, using bower, gulp and Strongloop, and i would like to add a bower componenent to the app (this one : https://github.com/fraywing/textAngular).
i did bower install textAngular as explained in the readme file, but now i should add those lines to my app :
<link rel='stylesheet' href='/bower_components/textAngular/dist/textAngular.css'>
<script src='/bower_components/textAngular/dist/textAngular-rangy.min.js'></script>
<script src='/bower_components/textAngular/dist/textAngular-sanitize.min.js'></script>
<script src='/bower_components/textAngular/dist/textAngular.min.js'></script>
But my app is using Strongloop, gulp and coffee script, so there is lot of file, not looking like classic html file and i am totally lost.
Can you help me find the next step to make this works ?
Thanks alot :)
I finally found my mistake, i need to add --saved at the end of bower command line.
So real line is : bower install textAngular --saved
Plus i should add textAngular in my angular module definition :
angular.module "starter", [
...
"textAngular"
...
]
Note that you should install too font-awesome and rangy to make it works completly

What is the physical path of Odoo webserver?

I'm building a custom odoo module that will be using several Javascript libraries.
I need to add references to those libraries (local references) but I don't know exactly where to place those libraries and how to refer to their location.
What I tried:
- I created the new module and placed the libraries inside the module directory but it didn't work.
- I also placed the libraries in the home directory of odoo.
As I understand, the problem would be solved if I could get the default directory of the webserver that odoo runs on.
If module is using js files, then you must put these files inside your module. And still if you cant reach these files from your module its your technical error and you have to fix it yourself, also note that odoo has its js libraries already
I found this page: how to add css and js files in Openerp 7 / Odoo module maybe can help you.
Below is the content.
Store files correctly:
CSS and JS files should be reside under 'static' directory in the module(the rest of subdirectory tree under 'static' is an optional convention):
static/src/css/your_file.css
static/src/js/your_file.js
Add files in manifest (v7.0) or in XML(v8.0)
Openerp v7.0 way is to add following entries in manifest (in openerp.py):
...
'css': ['static/src/css/your_file.css'],
'js': [static/src/js/your_file.js'],
...
Odoo v8.0 way is to add corresponding record in the XML:
Add XML to the manifest (openerp.py):
...
'data': [ 'your_file.xml'],
...
Then add following record in 'your_file.xml':
<data>
<template id="assets_backend" name="your_module_name assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel='stylesheet' href="/your_module_name/static/src/css/your_file.css"/>
<script type="text/javascript" src="/your_module_name/static/src/js/your_file.js"></script>
</xpath>
</template>
....
....
</data>

Deploying as a standalone page

During the development process, I've been using elm-reactor to test my one-page Elm application. But for production deployment, I would like to just store the compiler's output as static files on a webserver.
How do I compile an Elm page into a standalone pair of HTML + Javascript files?
Use elm-make to compile your Elm application to elm.js (target the module that defines main).
Create your own HTML file that includes that script and a script in the body that executes Elm.<Module-that-defines-main>.fullscreen()
Example
App.elm
module App where
import Text
import Signal
import Graphics.Element (Element)
main : Signal Element
main = "Hello World!" |> Text.asText |> Signal.constant
elm-make App.elm (creates elm.js)
App.html
<!DOCTYPE html>
<html>
<head>
<script src="elm.js" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">Elm.App.fullscreen()</script>
</body>
</html>
The answer to this ticket on the github project page is also quite helpful:
Finally, use this command to compile the file into a single, stand-alone HTML file.
$ elm make start-test.elm --output index.html