I want to change my site using Hugo. I get stuck with modules. As per documentation (e.g. this theme) I just add theme = "github.com/nodejh/hugo-theme-mini" to the config file. It fails like this:
WARN ... found no layout file for "HTML" for kind "term": You should ...
if I perform hugo mod vendor the directory structure of the theme seems created in the _vendor dir, but there is not a single file inside. which explains the "not found" error in my eyes.
nothing (!) is rendered.
I also have this effect with a couple of other themes (I thinknoteworthy being one of them).
Set up a clean project
hugo new site testModules
cd testModules
and enable Hugo modules
hugo mod init randomName`
Paste the following lines in config.toml:
baseURL = "http://example.org/"
title = "Hugo Modules Test"
[module]
[[module.imports]]
path = "github.com/nodejh/hugo-theme-mini"
Start Hugo
hugo serve -D
Done!
The content of github.com/nodejh/hugo-theme-mini" will be downloaded and used as theme.
See the theme's documentation to add content
Optional:
hugo mod vendor
will make the content of the remote repo available in the _vendor folder.
(Surprisingly the content of exampleSite was not downloaded during the quick test I made)
Related
I'm making a Jekyll theme using the command jekyll new-theme mytheme. I want to add translations to this theme, so I created the file _data/translations.yml into the root directory. This is its content:
---
en:
post: "Post"
es:
post: "Artículo"
I get the information with this expressions:
{% assign t = site.data.translations %}
{{ t[site.lang]['post'] }}
This setup only works if I move the _data/translations.yml file to my Jekyll website directory, created through the command jekyll new mysite.
Are the data files out of themes territory? Should I place this yml file in another directory? If it's not possible to use it in the themes territory, I would like to set a default value: how can I achieve this?
Thanks in advance.
As of Jekyll 4.0, yes, data files inside a theme-gem are not read.
You'll need to use a plugin named jekyll-data (authored by me).
If you plan to publish the theme for other users, I recommend adding the plugin as a runtime dependency in the theme's gemspec. Otherwise, simply adding the plugin to the :jekyll_plugins group in the site's Gemfile will suffice.
I'm writing some docs for Sphinx/rst. How can I link to something on local disk which is relative to the page you're viewing?
For example:
====================
My App documentation
====================
The official My App documentation can be found here:
https://myapp.com/docs
A local mirror is available:
../../_static/docs_mirror/index.html
On my machine, the _static folder resides in:
file:///Users/fredrik/code/repos/myapp/docs/_static
...but I don't want to hard-code that path, as that path might not be the same path for another user who has downloaded cloned the repository.
Here is one way to do it:
`local mirror <_static/docs_mirror/index.html>`_
Another option:
`local mirror`_
.. _local mirror: _static/docs_mirror/index.html
Reference: http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#hyperlink-references.
I am testing out Pelican for my personal blog use but I am stuck with the use of plugins.
Apparently, the pelicanconf.py file is not picking up my plugins.
Here's a snippet of my pelicanconf.py:
THEME = '/Users/namely/Public/MyPersonalWorkspace/static_blog/static-blog/pelican-themes/pelican-bootstrap3'
PLUGINS_PATHS = ["./plugins","plugins","./pelican-plugins","pelican-plugins","/Users/namely/Public/MyPersonalWorkspace/static_blog/static-blog/pelican-plugins"]
PLUGINS = ["sitemap"]
My pelican setup for theme is correct since I am using the theme correctly. But somehow, it is not reading my plugin directories. The following is my folder structure:
static-blog/
content/
output/
pelican-plugins/
sitemap/
__init__.py
sitemap.py
Readme.rst
plugins/
sitemap.py
pelican-themes/
pelican-bootstrap3/
# and all pelican-bootstrap3's files
pelicanconf.py
publishconf.py
develop_server.sh
fabfile
Makefile
I am using Pelican 3.4, on a Macbook Air ( OSX 10.9.4 ), Python version 2.7.5
I am using a list of directories for PLUGIN_PATHS since all the directories didn't work ( either individually or in a list, relative or absolute. ).
My pelican installation is working fine since I can run my blog. It's just that the plugins are not working somehow. For plugins, I simply did a git clone from https://github.com/getpelican/pelican-plugins.
The error message I received was:
ERROR: Can't find plugin `sitemap`: No module named sitemap
Any advice is great!
Thank you all!
It might be something as simple as a typo in your settings file. As noted in the docs, the name of the relevant setting is PLUGIN_PATHS, whereas your settings file appears to contain PLUGINS_PATHS (note the spurious S).
I want to create a link that refers to a section defined in another file.
I have found a similar question on "Python-Sphinx: Link to Section in external File" and I noticed there is an extension called "intersphinx".
So I tried this extension, but it doesn't work (Probably my usage is wrong).
I have tried the following.
conf.py
extensions = ['sphinx.ext.todo', 'sphinx.ext.intersphinx']
...
intersphinx_mapping = {'myproject': ('../build/html', None)}
foo.rst
...
****************
Install Bar
****************
Please refer :ref:`Bar Installation Instruction<myproject:bar_installation>`
I want to create a link like 'Bar Installation Instruction' with above markup.
bar.rst
...
**************************
Installation Instruction
**************************
.. _bar_installation:
some text...
When I run make html, I get the following warning and the link is not created.
foo.rst: WARNING: undefined label: myproject:bar_installation (if the link has no caption the label must precede a section header)
Thanks in advance.
Looks like it's not able to find your mapping inventory file. The first part of the tuple serves as the base URL for your links while the second part is the path to the inventory file. I believe the auto downloading of the inventory files (when you pass None) only works with URIs and not file paths.
In this example, I can build the documentation locally, but it will link to http://example.com/docs/bar.html
'myproject': (
'http://example.com/docs/',
'../html/objects.inv'
)
I have a Django 1.4 project, running on Python 2.7 in which I'm using Dajaxice 0.5.4.1. I have set it up on my development machine (Windows 7) and everything works perfectly. However when I deploy my app to production server (Ubuntu 12.04) I get 404 error for dajaxice.core.js file and cannot resolve this problem no matter what. Production server works with exactly the same versions of all software.
My project structure looks like this:
/myproject
/myproject/myproject-static/ <-- all the static files are here
/myproject/myproject-static/css/
/myproject/myproject-static/img/
/myproject/myproject-static/js/
/myproject/templates/
/myproject/myproject/
/myproject/main/
/myproject/app1/
/myproject/app2/
/myproject/app3/
etc.
I was following the Dajaxice installation steps here and put everything in its place (in settings.py, ˙urls.pyandbase.html` files).
My settings.py file has also these values:
from unipath import Path
PROJECT_ROOT = Path(__file__).ancestor(3)
STATIC_ROOT = ''
STATIC_URL = '/myproject-static/'
STATICFILES_DIRS = (
PROJECT_ROOT.child('myproject-static'),
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'dajaxice.finders.DajaxiceFinder',
)
DAJAXICE_MEDIA_PREFIX = "dajaxice"
DAJAXICE_DEBUG = True
I have an Alias directive in my django.conf file which looks like this:
Alias /myproject-static/ "/path/to/myproject/myproject-static/"
I did collectstatic on my production server and got all static files collected within few folders in the root of my project. So, now when I look at my deployed web site, I can see that CSS is properly applied, JavaScript is working fine and navigation around the site works as intended. Everything is fine except Ajax is totally broken since dajaxice.core.js is never included.
My project folder structure after collecting static looks like this:
/myproject
/myproject/myproject-static/ <-- all the static files are originally here
/myproject/myproject-static/css/
/myproject/myproject-static/img/
/myproject/myproject-static/js/
/myproject/templates/
/myproject/admin/ <-- folder created with 'collectstatic' command
/myproject/css/ <-- folder created with 'collectstatic' command
/myproject/dajaxice/ <-- dajaxice.core.js is located here
/myproject/django_extensions/ <-- folder created with 'collectstatic' command
/myproject/img/ <-- folder created with 'collectstatic' command
/myproject/js/ <-- folder created with 'collectstatic' command
/myproject/myproject/
/myproject/main/
/myproject/app1/
/myproject/app2/
/myproject/app3/
etc.
Am I doing something completely wrong with my static files here?
What else should I try to fix this simple error?
Have you check if as the rest of the assets, dajaxice.core.js is inside your static/dajaxice folder? If not, the issue could be related with a miss configuration of the STATICFILES_FINDERS, check Installing dajaxice again
Another usual issue with collectstatic and dajaxice is to run the first using --link Are you using this option?
Hope this helps
I spend several hours grappling with this problem. It was crazy because everything worked great on my dev environment, but not on the test server even though all the dajax and dajaxice settings were on a common base settings file. I never got it to work using the standard route. But this is a very easy fix:
1) Download dajaxice.core.js into whatever static directory pleases you. You can find the js in your the dajaxice directory in your project root:
project/dajaxice/dajaxice.core.js
In my case, I put the file in static/js alongside all my other js libraries.
2) On your web page, replace this:
{% dajaxice_js_import %}
with a normal, everyday link to the js library. In my case:
<script src="/static/js/dajaxice.core.js" type="text/javascript"></script>
Unfortunately, this patch only works for developed code. If you usedo it in the development environment, new dajaxice code will be registered in the original project/dajaxice/ location and so the file will have to be copied to static after any new code is developed.