jandecaluwe / urubu Goto Github PK
View Code? Open in Web Editor NEWA micro CMS for static websites, with a focus on good navigation practices.
Home Page: urubu.jandecaluwe.com
License: GNU Affero General Public License v3.0
A micro CMS for static websites, with a focus on good navigation practices.
Home Page: urubu.jandecaluwe.com
License: GNU Affero General Public License v3.0
May I ask a naive question? In the root of my project alongside the more
dropdown menu I have created a new folder with an index.md
as follows:
---
title: Engenhos A-M
layout: index
dropdown: true
content:
- acrylamid
- brunch
- cactus
- docpad
- engineer
- grow
- hugo
- hexo
- jekyll
- jigsaw
- lektor
- middleman
---
As you can see, these are examples of static site generators. Each will have a manual page à la middleman.md
with a briefing and basic rundown on the project in Brazilian Portuguese. There will be a Engenhos N-Z folder as well, of course.
Now when I go to urubu build
and debug I receive the message undefined reference: acrylamid
Oh, but wait, wait.
You know what it was?
A reference id is not assigned to markdown files without front matter.
[Bonks forehead] ...
I ported this project over from attempts to make material-docs
in Hugo and Mkdocs work for my needs. Previous
and next
navigation for example. Do not need it in the navbar, where I want to create several dropdowns.
Hi,
We want to make use of anchors and reference links. http://urubu.jandecaluwe.com/manual/authoring.html#reference-links
It is great that Urubu supports and checks global references, but that seems to fail when using anchors.
In other words, we can link to [here#subsection]
but if the subsection does not (or no longer) exist, we're in trouble, because the link will open the correct page, but won't jump to the right section.
Am I missing anything? How could we build a safeguard for this?
Hi,
I am trying to lay out some content from markdown in a template using multiple blocks.
First I just tried using the {% block foo %}something{% endblock %}, but that obviously didn't work,
and then I tried putting it in a property with a name in the "header" for the markdown file, which worked better. But, since the content I was using also needed to use a jinja filter, it didn't turn out the way I wanted it, cause that doesn't seem to be parsed for those parts of the markdown file.
Is there a way to do this properly?
Hi is their a way to include pagination i.e top 5 -10 posts /news.
Simply by modifying the repo's "urubu/doc/index.md" adding, before the HTML, the following markdown linking to a "project-wide ref. id" (i.e. a page from the "manual" sub-folder):
[Sample Structure][structure]
results in:
md_extensions.py:90: UrubuWarning: Undefined ref [structure] in file './index.md'
md_extensions.py:90: UrubuWarning: Undefined ref [sample structure] in file './index.md'
I believe the "structure" reference should link to a .md inside the "manual" sub-folder, through Urubu's "project-wide ref ids" instead of through a Markdown's reference-style link (where [...] are defined below).
I think this may be related to the manual's description of this ref. ids, where it says about them: "Urubu will resolve them depending on the file location in the project."
I have a page with a TOC that is too long. Is there a way to limit the TOC to only level 1 and level 2 entries?
Example page: http://insights.sigasi.com/manual/editor.html
I browsed the whole documentation but could not find any reference or example for how to work with media files, especially images. Should I just put them in the same folder as text and embed them with ![Alt text](/path/to/img.jpg)
?
Urubu only avoids processing file names prefixed with underscore or dot at the project root level.
It would be nice if the same ignore behaviour worked across folders.
So many open issues and stop release since 2016
It would be great to be able to have a date-field like this:
2011-10-08T17:06:47+02:00,
or even in a string like this:
'2011-10-08T17:06:47+02:00'
but urubu only accepts 2011-10-08. This can be problematic if you have two posts on the same day.
I stumbled upon this bug (or maybe its intended) when I tried to generate a project from a bunch of personel wiki-pages, which have title-case filenames like 'Static-HTML-Generators.md'.
Reproducable with:
git clone https://github.com/jandecaluwe/urubu-quickstart.git
cd urubu-quickstart
mv organize.md Organize.md
make
The error message is this:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/urubu/__main__.py", line 20, in <module>
main.main()
File "/usr/local/lib/python2.7/dist-packages/urubu/main.py", line 48, in main
project.build()
File "/usr/local/lib/python2.7/dist-packages/urubu/project.py", line 460, in build
proj.make_breadcrumbs()
File "/usr/local/lib/python2.7/dist-packages/urubu/project.py", line 356, in make_breadcrumbs
breadcrumbs.append(self.site['reflinks'][id])
KeyError: u'/Organize'
Makefile:6: recipe for target 'build' failed
make: *** [build] Error 1
So, the reflink id is assumed to be the filepath without extension here, while it is lowercased at another place in the code, thus resulting in an KeyError while looking it up.
I would sugget to make a clear distinction between the id anf the URL of an reflink while make it possible to have non-lowercased content files. A quick fix would look like this:
diff --git a/urubu/project.py b/urubu/project.py
index 2064747..512f5f4 100644
--- a/urubu/project.py
+++ b/urubu/project.py
@@ -71,6 +71,9 @@ def get_components(path, hasext=True):
return components
+def make_url(components):
+ return ('/' + '/'.join(components))
+
def make_id(components):
return ('/' + '/'.join(components)).lower()
@@ -241,7 +244,7 @@ class Project(object):
info['id'] = make_id(components)
# make html url from ref
info['url'] = self.finalize_local_url(
- info['id'] + self.site['link_ext'])
+ make_url(components) + self.site['link_ext'])
info.update(meta)
return info
@@ -353,6 +356,7 @@ class Project(object):
comps = comps[:-1]
for comp in comps:
id = id + '/' + comp
+ id = id.lower()
breadcrumbs.append(self.site['reflinks'][id])
info['breadcrumbs'] = breadcrumbs
(Maybe introducing make_url() which is almost a complete duplicate of make_id() is not that elegant). Should I create a PR?
Python2 is end of life, so it will be good to porting the project in 3.
There is a strange interaction between smarty and reference links. When a paragraph contains quotes, and also a reference link starting on a new line, the rendered html is not correct. There is a space missing between the link and the word that precedes it.
To be reviewed and revisisted later. I don't think this is a bug in Urubu itself. I am disabling smarty for now.
If I am, say, at a university where my webspace is at http://univ.edu/~name/, is there a way to prefix all internal reflinks by that URL? It seems now that urubu assumes it lives at the base directory.
I try the system, but haven't luck, the result is this
$ make
bash: make: command not found
I'm on Windows 10
Please ignore or close this issue. I thought I had discovered a bug, but now I can't reproduce it. I will open a new issue with better details if I run into it again.
The subject says it all: it's be nice if urubu could generate a sitemap.
Searching appears to be broken when running Urubu 1.3.0 with Python 3.6.4. When searching, no results are returned. When testing with the latest Python 2.7, searching functions as expected. I am testing with the Quickstart site.
Here is the exception when building:
(urubu_p364) urubu-quickstart-master>python -m urubu build
Traceback (most recent call last):
File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/cek/virtual_environments/urubu_p364/lib/python3.6/site-packages/urubu/main.py", line 20, in
main.main()
File "/home/cek/virtual_environments/urubu_p364/lib/python3.6/site-packages/urubu/main.py", line 51, in main
project.build()
File "/home/cek/virtual_environments/urubu_p364/lib/python3.6/site-packages/urubu/project.py", line 489, in build
proj.make_site()
File "/home/cek/virtual_environments/urubu_p364/lib/python3.6/site-packages/urubu/project.py", line 470, in make_site
self.process_content()
File "/home/cek/virtual_environments/urubu_p364/lib/python3.6/site-packages/urubu/project.py", line 476, in process_content
p.process()
File "/home/cek/virtual_environments/urubu_p364/lib/python3.6/site-packages/urubu/processors.py", line 106, in process
self.make_tipuesearch_content()
File "/home/cek/virtual_environments/urubu_p364/lib/python3.6/site-packages/urubu/processors.py", line 205, in make_tipuesearch_content
data = json.dumps(obj, fd, ensure_ascii=False, indent=4, sort_keys=True)
TypeError: dumps() takes 1 positional argument but 2 positional arguments (and 3 keyword-only arguments) were given
Any ideas here?
Hello, I'm impressed with Urubu, thank you for making it. 🏆
I'm interested in adding a search feature to Urubu, do you have any suggestions the best way to go about that? I'm assuming a Javascript client-side search will probably be the only option.
Generally all pages under a folder (with it's own index.md
) use the same layout
- given a few exceptions. It would be nice if we could set a (default) layout
in those index.md
file(s), instead of needing to set it in every pagex.md
(but pagex.md
should be able to overwrite this default).
FAQ still has the "What are the licensing requirements?" page which uses the software_license
from doc/_site.yml
If I choose to order by date in /foo/index.md
, then I get an error unless every file in every subdirectory of /foo/
has a date attribute defined. This means that I cannot order the directory /foo/bar
by title.
Also I think the error handling is a little opaque. IMO, it'd be better to give a warning and do something reasonable in cases when attributes are undefined rather than error out altogether.
First of all, thank you for the great engine!
Is there any way to generate RSS feeds? I'd like to have feeds for each folder in my site.
If not, is there any plan of implementing this?
I could give a hand but I have no idea how these things are done.
I have created an Urubu project that I host on GitHub. On GitHub is is recommended to have a README.md in the root folder of a project. However, when I add this file, Urubu warns me that this file does not have a yaml frontmatter.
/usr/lib/python2.7/site-packages/urubu/readers.py:35: UrubuWarning: No yaml frontmatter found in ./README.md
warnings.warn(yamlfm_warning.format(fn), UrubuWarning)
/usr/lib/python2.7/site-packages/urubu/project.py:176: UrubuWarning: No yaml front matter in './README.md' - ignored
warn(yamlfm_warning.format(relfn), UrubuWarning)
What is the recommended way to deal with this?
Hi,
Is there a way to change the _build folder ?
Best
hi.
i installed the app: http://urb.brite.biz.st/blog ,but the published posts' order are not arranged as per the publishing time,this post http://urb.brite.biz.st/blog/test1.html is published before the post
http://urb.brite.biz.st/blog/test2.html ,it should be below http://urb.brite.biz.st/blog/test2.html ,but actually not.so how to correct the posts order?
another issue: how to paginate?
tks.
Trigger: When you give a markdown file a title that is an integer (e.g. title: 2016).
Result: Search stops working.
The fact that search stops working is because in a tipuesearch_content.json this results in:
"title": 2016,
When you add quotes manually the search works again:
"title": "2016",
I am thinking to remove the markdown-checklist extension. It is non-standard and interferes with the reference link resolution in Urubu. I also think we may be able to something more general by using reference links themselves to do certain substitutions (e.g. a piece of html instead of links).
Objections or other feedback?
A minor documentation comment: it took a lot of back-and-forth to find the Urubu Quickstart link. (Including typing 'urubu -h' to see if there was an empty project generator the way it is for rails etc.) The only reference being an link buried at the bottom of the 'Installation' page.
Most open source projects dedicate a full Quickstart chapter in their documentation. That's not necessarily the right way of doing it, but it's probably not a bad idea to make Quickstart a bit more visible?
Thanks for listening!
I deployed with the suggested command line instruction:
git subtree push --prefix _build origin gh-pages
I was deploying to a site under the root of <MYNAME>.github.io/<MYPROJECT>
as instructed.
The deploy was unsuccessful. Pages two levels down from the root are not uploaded. Or at least they are not served, let me check.
Okay, they are uploaded but not served.
Where did I go wrong?
The thing is that I have deployed successfully to surge from /home/usr/urubuproject/_build
.
What I would really like to do is publish to a USERNAME.github.io
personal site. How would I do that?
Chris (Felton) and I added a browser-tab logo for the MyHDL site. I suppose this would be an maintenance for all urubu users.
I added the in the _base.html but I guess there must be a better way to do this?
A side question: how can I 'promote' an issue to 'enhancement' (or other label)?
Hi!
Thanks for CMS. It's real good.
Please add the possibility of adding my own template tags...
It's available like:
env = jinja2.Environment()
env.globals['custom_tag'] = custom_tag
But I can't use it.. :/
Hi,
I'm runing urubu in win7+python2.7.9+virtualenv. it report an error when I added some deep sub-directories. I can't figure out why it complain "No 'content' or 'order'" in the index.md file. could you please give me a hint on this problem? thanks a lot!
here is the build error msg:
(webdev) R:\infohub>python -m urubu build
Traceback (most recent call last):
File "C:\WinPython\python-2.7.9.amd64\Lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\WinPython\python-2.7.9.amd64\Lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Users\jliut\Envs\webdev\lib\site-packages\urubu\__main__.py", line 20, in <module>
main.main()
File "C:\Users\jliut\Envs\webdev\lib\site-packages\urubu\main.py", line 48, in main
project.build()
File "C:\Users\jliut\Envs\webdev\lib\site-packages\urubu\project.py", line 457, in build
proj.get_contentinfo()
File "C:\Users\jliut\Envs\webdev\lib\site-packages\urubu\project.py", line 187, in get_contentinfo
self.validate_navinfo(relfn, navinfo)
File "C:\Users\jliut\Envs\webdev\lib\site-packages\urubu\project.py", line 233, in validate_navinfo
raise UrubuError(undef_content_error.format(relfn))
urubu.UrubuError: No 'content' or 'order' specified in technotes\flexing\index.md
here is my directory structure.
project-dir
|--_site.yaml
|-- index.md
|-- technotes
|--flexing
|--index.md
and the content of 'technotes\flexing\index.md':
---
title: FlexiNG Technical Notes
layout: page
pager: true
---
First section
=============
Second Section
=============
The issue of project output files and templates both assuming html for everything could use some refactoring.
-- to use as base for rss-feeds
The attached markdown file (bug.zip) results in following error because of "{{{" "}}}" in fenced code blocks:
Traceback (most recent call last):
File "/usr/lib64/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/lib/python2.7/site-packages/urubu/__main__.py", line 20, in <module>
main.main()
File "/usr/lib/python2.7/site-packages/urubu/main.py", line 51, in main
project.build()
File "/usr/lib/python2.7/site-packages/urubu/project.py", line 489, in build
proj.make_site()
File "/usr/lib/python2.7/site-packages/urubu/project.py", line 470, in make_site
self.process_content()
File "/usr/lib/python2.7/site-packages/urubu/project.py", line 476, in process_content
p.process()
File "/usr/lib/python2.7/site-packages/urubu/processors.py", line 104, in process
self.convert()
File "/usr/lib/python2.7/site-packages/urubu/processors.py", line 120, in convert
raise UrubuError(str(exc), msg=msg, fn=fn)
urubu.UrubuError: in releasenotes/bug.md: <class 'jinja2.exceptions.TemplateSyntaxError'>: 'unexpected '}', expected ']''
Makefile:10: recipe for target 'build' failed
make: *** [build] Error 1
I could work around the issue by adding zero-width spaces between the braces
When moving from jekyll to urubu (which went great, thanks!!!), I found that in urubu my markdown needs to be "pure", i.e. it is not possible to contain {% ... %} markers with templating instructions.
Would it be possible to do this in urubu as well?
I needed this because on my site images were not done with img-tags, but with figure-tags (and had a caption as a parameter). The standard markdown templating engine will always render img-tags.
urubu functions as until now are:
build
server
add new functions like
add-tags
: provide a basic template to add tags to your projectAny thoughts?
We were migrating some markdown from a wiki. There are stray references we are in the process of converting manually. One of them ([[kkkk©|kkkk]]
) caused an unrecoverable UnicodeEncodeError:
paolog@matanui:/tmp/qq$ urubu build
Traceback (most recent call last):
...
File "/usr/local/lib/python2.7/dist-packages/urubu/md_extensions.py", line 110, in handleMatch
warn(undef_ref_warning.format(ref, this['fn']), UrubuWarning)
File "/usr/lib/python2.7/warnings.py", line 29, in _show_warning
file.write(formatwarning(message, category, filename, lineno, line))
File "/usr/lib/python2.7/warnings.py", line 38, in formatwarning
s = "%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa9' in position 20: ordinal not in range(128)
This makes the actual source of the problem difficult to find. I believe you should use string.text.encode('ascii', 'ignore')
somewhere.
BTW great tool thanks for sharing.
If I have a folder with an index.md file that has content sorted on date, and I want another index file, say index-january.md, that includes all my posts from january (and thus a predefined content), this index-january.md file will be included in the index.md content.
What is a way to work around this?
The Google Analytics ID is currently stored in an html file in the _layout folder. It would be more appropriate to strore this information in the _site.yml file. That way, the entire _layout folder can be reused over several sites without modifications. The parameter could be called google_analytics
.
This does not require a change to Urubu itself. Instead I would like to propose a patch to urubu-quickstart. Would you welcome such a patch?
In the upcoming release, 1.0.0, I will deprecate validators
in favor of a new hook called process_info
. In a first step, I will remove validators
from the documentation.
process_info
is more powerful in the sense that in doesn't require a valid layout
attribute in a file, unlike validators
. It can therefore be used to provide meaningful default values for layout
if the attribute is missing. I know this is a feature that some people find useful. By doing this in a python hook, it is completely general and can be tailored to the layouts in a site.
Of course, more sophisticated attribute processing is also possible, just like with validators
. validators
was a misnomer anyway because any processing is possible, not just attribute validation.
Hello!
First of all, thank you for Urubu! It's just the kind of static site generator I was looking for — fast and simple.
Now, to the actual question. I have for now created just one file named index.md
, which contains the following:
---
title: Home
layout: fw_index
order: date
---
# Welcome!
This is a test ForstWoof from Urubu generator.
The code generated is this:
<h2 id="welcome">Welcome!</h2>
<p>This is a test ForstWoof page from Urubu generator.</p>
Why for one hash sign header it created a second-level header? According to the official Markdown specs, one hash sign means the header of the first level. I doubt that this is an issue of Urubu, but I don't know where else to post this. Thank you in advance for support!
Repro:
In urubu-quickstart root:
mkdir my_multipage_article
cp content.md my_multipage_article/1.md
urubu build
Gives the following error:
Traceback (most recent call last):
File "/usr/local/bin/urubu", line 9, in <module>
load_entry_point('urubu==1.0.0', 'console_scripts', 'urubu')()
File "/usr/local/lib/python2.7/site-packages/urubu/main.py", line 52, in main
project.build()
File "/usr/local/lib/python2.7/site-packages/urubu/project.py", line 475, in build
proj.make_breadcrumbs()
File "/usr/local/lib/python2.7/site-packages/urubu/project.py", line 353, in make_breadcrumbs
breadcrumbs.append(self.site['reflinks'][id])
KeyError: u'/my_multipage_article'
When the file 1.md is in the project root, there are no issues.
hello sir,
i have no ideal about how to use tags,
could you show me an example of code?
Hi
When trying to build with markdown-checklist then I get following errors:
/usr/lib/python2.7/site-packages/urubu/md_extensions.py:90: UrubuWarning: Undefined ref [ ] in file './index.md'
warn(undef_ref_warning.format(ref, this['fn']), UrubuWarning)
/usr/lib/python2.7/site-packages/urubu/md_extensions.py:90: UrubuWarning: Undefined ref [x] in file './index.md'
warn(undef_ref_warning.format(ref, this['fn']), UrubuWarning)
* [ ] a task list item
* [ ] list syntax required
* [ ] normal **formatting**, @mentions, #1234 refs
* [ ] incomplete
* [x] completed
Also I get similar errors when links contain square brackets. For example:
[XDA Forum: [KERNEL][NEO/V] LuPuS GBv2 [STOCK GB][LINARO 4.7.3] 20-06-13](http://forum.xda-developers.com/showthread.php?t=2295074)
Every markdown parser I know renders this fine:
Here is a list.
Title 1
Indented content 1
Title 2
Indented content 2
except for the one in urubu (which I believe is the standard python one?), where the indented content is not indented at all.
(the editor here on github seems to parse this as well, so to be clear, this is a gist with the problematic markdown: https://gist.github.com/kristofvanlandschoot/ed5d0eb33c721ddade78 )
I guess in the long run commonmark is the way to go, so compliance with commonmark would be great. Commonmark renders this correctly.
If you have tags with upper case characters, links to the corresponding tag pages are incorrectly converted to lower case.
tags :
- lower
- UPPER
---
[Links to lower case tags work fine][/tag/lower]
[Links to UPPER case tags fail][/tag/UPPER]
The [/tag/UPPER]
get converted to <a href="/tag/upper/" title="UPPER">Links to UPPER case tags fail</a>
.
I faced this problem while configuring a custom Urubu website, but here is how you reproduce it using the default project:
log
---I wanted to use that name instead of blog
--- and put an index and some posts inside; or just copy from blog
tag
directory to enable tags, and make sure to drop an index.md
in there. I'm simply using:
---
title: Tags
layout: index
order: title
---
Then Urubu (1.2.0) will stop generating pagers for pages inside log
How would I create a page at domain.com/faq, for example? Ideally I could configure Urubu such that faq.md becomes faq/index.html, but setting file_ext to "/index.html" breaks the root index.md. And creating a 'faq/index.md' doesn't work because index pages are special and apparently can't just have straight content. So is there any way to create these clean urls?
Hi to all, thanks to all developers around this project. I would like to see this feature because I daily work in a "offline" network but Urubu can't load the necessary scripts to see the site. I tried to search all the javascript files but I am a bit beginner and I don't know where exactly put it. Do you thing it could be possible?
(Consider that "totally offline" static sites could be really wonderful for networks like zeronet, IPFS or Dat)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.