18910140161

HTML-如何更改GitHub页面主题中的下载按钮路径和文本?-堆栈溢出

顺晟科技

2022-10-18 12:54:27

105

我一直在尝试如何更改下载按钮路径,这样它就不会下载GH-Pages分支。我还想知道如何才能改变这些显示的文字。我一直在搜索互联网,看看是否能找到一种适合我的方法。

如果有帮助的话

我也在使用建筑师主题。

config.yml:

theme: jekyll-theme-architect
show_downloads: true

enter image description here


顺晟科技:

您在pages-themes/architectIssue 40中遇到了类似的问题,其中指出:

_layouts/default.html

<a href="{{ site.github.owner_url }}" class="button"><small>Follow me on</small> GitHub</a> 

_sass/jekyll-theme-architect.scss

<代码>标题A.Button{位置:绝对;顶部:0;权利:0;背景:透明网址(./images/github-button.PNG)0 0不重复; }
如果您有类似的资源声明,

请签入您自己的主题源代码,以供您更改。

 header a.button { 
   position: absolute; 
   top: 0; 
   right: 0; 
   background: transparent url(../images/github-button.png) 0 0 no-repeat; 
 }
从主题的default.HTML文件中

可以看到,您需要转到_config.yml并添加指向您希望在单击按钮时下载的ZIP和TAR文件的链接。这些可以像这样添加:

<aside id="sidebar">
      {% if site.show_downloads %}
        <a href="{{ site.github.zip_url }}" class="button">
          <small>Download</small>
          .zip file
        </a>
        <a href="{{ site.github.tar_url }}" class="button">
          <small>Download</small>
          .tar.gz file
        </a>
      {% endif %}

关于更改按钮文本,我不太确定如何进行。

  • TAG:
相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航