blog-related | Playground to test things before posting them on my blog | Blog library
kandi X-RAY | blog-related Summary
kandi X-RAY | blog-related Summary
Playground to test things before posting them on my blog
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of blog-related
blog-related Key Features
blog-related Examples and Code Snippets
Community Discussions
Trending Discussions on blog-related
QUESTION
Noob Pelican question here:
I want to include content on the main page of my pelican site that is not blog-related posts, but which simply reads an rst file and puts the results on the main page. I could put a single post together, but that really isn't what I want.
I can of course hack the index.html template and put the text directly there. But what I'd like to do is put some code there that would parse a file and put the same text there.
...ANSWER
Answered 2020-Nov-07 at 06:45One of the benefits of using Python as the settings file format is that Pelican can do what you want without having to write a plugin or modify Pelican itself.
Let’s say you have some introductory content stored in intro.rst
that you want to be rendered in your index.html
template. The following additions to your Pelican settings file will result in a new INTRO
variable that contains the rendered contents of the intro.rst
file.
QUESTION
The documentation states that I can configure the liferay server to use my own templates for the email messages. Specifically, if I add these properties to a portal-ext-env.properties
in $CATALINA_BASE/conf/liferay
:
ANSWER
Answered 2019-Sep-19 at 15:34After some digging, I've found that you place the templates in the $CATALINA_BASE/webapps/ROOT/WEB-INF/classes
folder. Paths that you reference in the properties (e.g. blogs.email.entry.added.body=${resource:com/liferay/portlet/blogs/dependencies/email_entry_added_body.tmpl}
) are relative to the aforementioned classes folder.
So, if I wanted Liferay to use a template file in the ff. relative path: org/foo/my_email_entry_added_body.tmpl
, I would do two things:
- Place the file in
$CATALINA_BASE/webapps/ROOT/WEB-INF/classes/org/foo/my_email_entry_added_body.tmpl
. - Add the following line to
$CATALINA_BASE/portal-ext-env.properties
:blogs.email.entry.added.body=${resource:org/foo/my_email_entry_added_body.tmpl}
.
I consulted my co-worker and got a better understanding of why this is. The architecture of a Liferay application is such that it comes bundled with a Tomcat server. According to the documentation, WEB-INF/classes
is a directory that a web app deployed to a Tomcat server looks up for classes and resources:
A class loader is created for each web application that is deployed in a single Tomcat instance. All unpacked classes and resources in the /WEB-INF/classes directory of your web application, plus classes and resources in JAR files under the /WEB-INF/lib directory of your web application, are made visible to this web application, but not to other ones.
Specifically, this folder is high in priorty in the web app's classpath.
When you see Liferay code similar to ${resource:path/to/foo}
, it's looking up resources in its classpath. One of the paths in that classpath is WEB-INF/classes
. Hence, if path/to/foo
is placed in WEB-INF/classes
, Liferay will find path/to/foo
there.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install blog-related
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page