Git Product home page Git Product logo

papaya's People

Contributors

cs-qyzhang avatar homeworkprod avatar justint avatar moppius avatar opeik avatar tmfink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

papaya's Issues

Clarify which customization steps are mandatory before `zola serve` succeeds

Your justint.github.io repo's README states:

Don't just fork/copy: there are specific things in here developed just for this site alone [...]

However, adding the Papaya theme is rather frustrating compared to doing exactly the above: forking justint.github.io.

I start from a clean zola init and add the theme.

After doing everything before Customization in the README.

❯ zola serve
Building site...
Warning: config.toml contains both default language specific information at base and under section `[languages.en]`, which may cause merge conflicts. Please use only one to specify language specific information
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 0 pages (0 orphan) and 2 sections
Error: Failed to serve the site
Error: Failed to render pager 1
Error: Reason: Failed to render 'blog.html'
Error: Reason: Variable `config.extra.color_mode` not found in context while rendering 'blog.html'

Ok, so I add color_mode to my config.toml. This is not mentioned anywhere in the README btw.

Try again:

❯ zola serve
Building site...
Warning: config.toml contains both default language specific information at base and under section `[languages.en]`, which may cause merge conflicts. Please use only one to specify language specific information
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 0 pages (0 orphan) and 2 sections
Error: Failed to serve the site
Error: Failed to render section '/home/moritz/code/virtualritz.github.io/content/_index.md'
Error: Reason: Failed to render 'index.html' (error happened in a parent template)
Error: Reason: Variable `config.extra.menu_items` not found in context while rendering 'index.html'

Ok, so the menu is mandatory. I read the resp. Customization section, add it, and try again:

❯ zola serve
Building site...
Warning: config.toml contains both default language specific information at base and under section `[languages.en]`, which may cause merge conflicts. Please use only one to specify language specific information
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 0 pages (0 orphan) and 2 sections
Error: Failed to serve the site
Error: Failed to render section '/home/moritz/code/virtualritz.github.io/content/_index.md'
Error: Reason: Failed to render 'index.html'
Error: Reason: Function call 'resize_image' failed
Error: Reason: `resize_image`: Cannot find file: /static/banner.jpg

That's when I gave up and forked justint.github.io and started modifying it. ☺

I guess I am trying to say: if you want users to not fork justint.github.io there are two options:

  1. Improve onboarding documentation for the theme in the README. I.e.: what do people need to do exactly before zola serve succeeds after adding the Papaya theme?
  2. Create a template repo. that can be forked. I.e. justint.github.io but stripped of specifics.

Language selector

Papaya now has i18n support, thanks to #3 ! 🎉

It would be great to add a language selector to the theme, to allow for easy switching to different languages.

This selector would ideally auto-populate the language options based off of what's defined in the config.toml and stay within the general theme's aesthetic. Perhaps it could be added to the footer as a simple listing of language options, eg:

EnglishFrançais

`zola serve` fails because `title` is specified twice

$ zola serve
Building site...
Warning: config.toml contains both default language specific information at base and under section `[languages.en]`, which may cause merge conflicts. Please use only one to specify language specific information
Error: Failed to serve the site
Error: `title` for default language is specified twice, as "Papaya" and "Papaya".

The warning is related to #12, which I need to update the theme on since the dependent changes in zola have now been released.

Papaya fails to build with Zola v0.16.1

I'm getting this error when building papaya with zola v0.16.1:

Error: Failed to serve the site
Error: Page `\\?\C:\Users\Justin\\papaya\content\blog\another-post.md` has taxonomy `tags` which is not defined in config.toml

Have not figured out the cause yet, will be investigating.

Removing additional languages

Hi!
Noob here, was attracted by how well-thought out and well-designed the theme is! (disclaimer to let you know this may be totally a me issue)

You mention in the guide that the theme supports additional languages. I was wondering if there is a clean way to remove this ability? When I try to remove language related lines in config.toml or in any other place, the site refuses to build, missing various language related items in multiple places.

Edited - Thanks Justin, it works! Wanted to follow your lead and not mark it closed, so didn't comment on your reply (close with comment).

Add i18n support

Hi, I'd like to add i18n support to this clean theme. I'm a newborn to Rust/Zola/Tera, so my knowledge is limited. I found three ways to do that:

  1. Add a base template for every language, in these templates assign corresponding text to variables, and then extends one of them in base.html, replace every language-specific text with corresponding variable. One problem is variable defined in base template cannot used inside macro, so variables can only be passed into macro by using additional parameters. Another problem is the path of extends keyword must be static, so in order to switch language it seems must change the path of extends keyword instead of changing config.toml.
  2. Define language-specific text in one macro, e.g. i18n::text(key), then use i18n::text(key="recent_projects") to get that text. This method seems better than method 1, but the macro definition is unelegent and will be very huge.
{% macro text(key) %}
  {% if config.extra.lang == "en" -%}
    {% if key == "recent_projects" -%}
      Recent projects
    {% elif key == "recent_blog_posts" -%}
      Recent blog posts
    {% elif key == "about" -%}
      About
    {% endif -%}
  {% elif config.extra.lang == "zh" -%}
    {% if key == "recent_projects" -%}
      近期项目
    {% elif key == "recent_blog_posts" -%}
      近期博文
    {% elif key == "about" -%}
      关于
    {% endif -%}
  {% endif -%}
{% endmacro %}
  1. Define langauge-specific text in config.toml. This method is the simplest way, gives user more control of language-specific text, but the config.toml will be large.

Menu item hyperlinks have extra slash between base_url and slug

<nav>
 <ul>
  <li><a href="http://127.0.0.1:1111//projects">Projects</a></li>
  <li><a href="http://127.0.0.1:1111//blog">Blog</a></li>
  <li><a href="http://127.0.0.1:1111//tags">Tags</a></li>
  <li><a href="http://127.0.0.1:1111//about">About</a></li>
 </ul>
</nav>

This commit attempted to solve this problem, but introduced a new issue where the menu items would be missing a "/" inbetween the base url and the menu item slug (eg: justintennant.me/papayablog instead of justintennant.me/papaya/blog) for sites hosted within a directory of a domain (eg: justintennant.me/papaya). I've since reverted it until I can find a more elegant solution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.