Skip to content
Code on GitHub (opens in a new tab)

Documentation · Guides

The structure of a project

What each folder holds, how it turns into addresses and what you should not version.

Version 0.16

An Ehundu project is a folder with the same names every time. This is what you will have almost always:

my-site/
  sitio.yml
  contenido/
    index.md
    blog/
      _datos.yml
      a-post.md
  datos/
    menus.yml
  plantillas/
    base.twig
    pagina.twig
  parciales/
    cabecera.twig
  publico/
    css/
    img/
    favicon.ico

The names of the folders are not configurable, and that is on purpose: once you have seen one project, you have seen them all. You can open someone else's, or move from one of yours to another, without working out how it is organised. They are Spanish words, like the whole format: the table below says what each one means.

What goes in each folder

Folder What it holds
sitio.yml (“site”) The name, the address and the rest of the configuration. It is the only required one.
contenido/ (“content”) Your pages, as .md and .twig. Each one generates a page, and its address comes from its path. What is not a page (a photo, a PDF) is copied as it is.
datos/ (“data”) What several pages use: the menu, the company details, the texts of the footer. A file datos/menus.yml is datos.menus in the templates.
plantillas/ (“templates”) The layouts that wrap the pages.
parciales/ (“partials”) Pieces of HTML to reuse with {% include %}. In parciales/atajos/ (“shortcuts”) are the templates of your shortcodes.
publico/ (“public”) The CSS, the JavaScript, the images, the fonts and the favicon. It is copied to the root of the site: publico/img/logo.svg ends up at /img/logo.svg.

From the path to the address

Each file in contenido/ becomes an address with its folder and its name, and index.md is the page of its folder:

contenido/index.md              →  /
contenido/servicios/index.md    →  /servicios/
contenido/servicios/diseno.md   →  /servicios/diseno/
contenido/blog/foto.jpg         →  /blog/foto.jpg

The last one is not a page, so it is copied with the same path. If you want another address for a page, you write it in its front matter with url.

What the pages inherit

A _datos.yml file inside a folder of contenido/ gives values to all the pages in that folder and in the ones below it. So, in contenido/blog/_datos.yml you put what all the posts share, and you do not repeat it in each one:

plantilla: articulo
etiquetas: [blog]

If a page writes the same field, the page wins. With etiquetas (“tags”), css and js there is no contest: they are added together.

What the engine writes

Ehundu only reads from the project folder and only writes in two places:

  • salida/ (“output”) is the finished site, the one you upload to the server. It is rebuilt on every build.
  • .ehundu/ is what the engine remembers from one build to the next, to rebuild only what has changed. You can delete it whenever you like: all you lose is the saving next time.

Next to them there may be a .secretos.yml (“secrets”) with the deployment passwords. None of the three goes into Git:

salida/
.ehundu/
.secretos.yml

Two things that catch people out

  • A dot in the name of a page is reserved for the language. contacto.eu.md is the contact page in Basque. That is why guia.v2.md or 2024.10.01-titulo.md stop the build with an error that names the file: use hyphens (guia-v2.md).
  • Files that start with an underscore are not copied to salida/. That is why _datos.yml does not reach the published site. .md and .twig files with an underscore are still pages.

The full detail is in the structure of the project (in Spanish) and in the content files (in Spanish).