GithubHelp home page GithubHelp logo

Comments (12)

davorpa avatar davorpa commented on June 10, 2024 3

Hi @chenrylee

Your proupose is interesting.

For backwards compatibility and taking a view on other themes it should be

{% _show_repository_url = site.show_repository_url | default: true %}
{% if _show_repository_url and site.github.is_project_page %}
          <a href="{{ site.github.repository_url }}" class="btn btn-github"><span class="icon"></span>View on GitHub</a>
{% endif %}

Also control other flags to remove the section container when apply.

<section id="downloads">
{% if site.show_downloads %}
<a href="{{ site.github.zip_url }}" class="btn">Download as .zip</a>
<a href="{{ site.github.tar_url }}" class="btn">Download as .tar.gz</a>
{% endif %}
<a href="{{ site.github.repository_url }}" class="btn btn-github"><span class="icon"></span>View on GitHub</a>
</section>

So the entire snippet takes this look more or less:

{% _show_repo_url = site.show_repository_url | default: true %}
{% if site.show_downloads or site.github.is_project_page and _show_repo_url %}
     <section id="downloads">
     {% if site.show_downloads %}
         <a href="{{ site.github.zip_url }}" class="btn">Download as .zip</a>
         <a href="{{ site.github.tar_url }}" class="btn">Download as .tar.gz</a>
      {% endif %}
      {% if site.github.is_project_page and _show_repo_url %}
          <a href="{{ site.github.repository_url }}" class="btn btn-github"><span class="icon"></span>View on GitHub</a>
      {% endif %}
      </section>
{% endif %}

The tasks to resolve in PR should be the following:

  • Apply changes to template.
  • Add the new optional bool parameter show_repository_url: true to _config.yml.

    hacker/_config.yml

    Lines 3 to 4 in 7b7303a

    show_downloads: true
    google_analytics:
  • Update documentation, README.md... to reflect its meaning.

    hacker/README.md

    Lines 32 to 43 in c84111d

    title: [The title of your site]
    description: [A short description of your site's purpose]
    ```
    Additionally, you may choose to set the following optional variables:
    ```yml
    show_downloads: ["true" or "false" to indicate whether to provide a download URL]
    google_analytics: [Your Google Analytics tracking ID]
    ```
    ### Stylesheet

from hacker.

Ak-wa avatar Ak-wa commented on June 10, 2024 2

Id like that feature too! You can do this yourself btw by adding:

---
---

@import "{{ site.theme }}";

header {
  display: none;
}

to /assets/css/style.scss

That will hide the View on Github button :)

from hacker.

davorpa avatar davorpa commented on June 10, 2024 2

@pil0u @chenrylee implemented as easy as posible and compatible with other themes

I hope mantainers accepts the pull request #81

from hacker.

pil0u avatar pil0u commented on June 10, 2024 1

💬 It will be a good option use the properties of github pluging (variable site.github.is_project_page) like is used in other themes or with simple site.show_repository_url is enough ⁉️

My first feeling is that the more customizable, the better. But as you mentioned all these issues, the real issue here is definitely to be able to get rid the button, so I'd say choose what's the fastest 😄

from hacker.

pil0u avatar pil0u commented on June 10, 2024 1

One or another, values provided by plugins can always be overriden in _config.yml, so maybe will be redundant to have both.

Absolutely, that's what I meant, just pick one.
Your previous comment sounds great 👍

from hacker.

pil0u avatar pil0u commented on June 10, 2024 1

Just noticed this section in the README. That's what I ended up doing by totally removing the line in the layout 👍

from hacker.

chenrylee avatar chenrylee commented on June 10, 2024

@Ak-wa Yeah, it works, but doesn't exactly meet my demands.
If hiding the header, the site name, site description are hidden as well.
What I exactly want to do is to only hide the View on github button.

TBH, I already changed the default.html.

from hacker.

pil0u avatar pil0u commented on June 10, 2024

Hey @davorpa, your approach seems great 👍 Any ETA to merge this?

from hacker.

davorpa avatar davorpa commented on June 10, 2024

Hey @davorpa, your approach seems great Any ETA to merge this?

Sorry @pil0u I forgot completely this request. I had forked the repo but I'm not be able to install a ruby environment locally to test it. 🤦

💬 It will be a good option use the properties of github pluging (variable site.github.is_project_page) like is used in other themes or with simple site.show_repository_url is enough ⁉️

You can see the result in my previous post

Also related with #45 #42 #26 #25 #16 #14 #3

from hacker.

davorpa avatar davorpa commented on June 10, 2024

My first feeling is that the more customizable, the better. But as you mentioned all these issues, the real issue here is definitely to be able to get rid the button, so I'd say choose what's the fastest 😄

One or another, values provided by plugins can always be overriden in _config.yml, so maybe will be redundant to have both.

github:
    is_project_page: false

The authentic flexibility goes by the hands on page. variables, Are provided as meta in any page that extends the layout (e.g. default.html > about-me.html) and therefore can be enhaced to take prevalence from those defined in above file.

{% if  page.show_repository_url | default: site.github.is_project_page %}

B.R.

from hacker.

stale avatar stale commented on June 10, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from hacker.

davorpa avatar davorpa commented on June 10, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Bump. #81 already open and valuable

from hacker.

Related Issues (20)

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.