Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support base_url for internal links #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<footer class="footer">
<nav class="footer-nav">
{% for navpage in site.nav.footer %}
<a class="footer-nav-link" href="{{ navpage.url }}">{{ navpage.name }}</a>
<a class="footer-nav-link" href="{% if navpage.url contains 'http' %}{{ navpage.url }}{% else %}{{ site.baseurl }}{{ navpage.url }}{% endif %}">{{ navpage.name }}</a>
{% endfor %}
</nav>
<div class="credit">
Expand Down
6 changes: 3 additions & 3 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<header class="header">
<div class="header-logo">
<a href="/"><img class="logo-img normal-logo" src="/images/question2answer-logo-white-350x40.png" alt="Question2Answer logo"></a>
<a href="/"><img class="logo-img normal-logo" src="{{ site.baseurl }}/images/question2answer-logo-white-350x40.png" alt="Question2Answer logo"></a>
</div>
<nav class="top-nav main-nav">
{% for navpage in site.nav.main %}
<a class="main-nav-link" href="{{ navpage.path }}">{{ navpage.name }}</a>
<a class="main-nav-link" href="{{ site.baseurl }}{{ navpage.path }}">{{ navpage.name }}</a>
{% endfor %}
{% for navpage in site.nav.second %}
<a class="main-nav-link {{ navpage.class | default: '' }}" href="{{ navpage.url }}">{{ navpage.name }}</a>
<a class="main-nav-link {{ navpage.class | default: '' }}" href="{% if navpage.url contains 'http' %}{{ navpage.url }}{% else %}{{ site.baseurl }}{{ navpage.url }}{% endif %}">{{ navpage.name }}</a>
{% endfor %}
</nav>
</header>
2 changes: 1 addition & 1 deletion _includes/nav-sub.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h4 class="docs-nav-title">{{ navpage.name }}</h4>
{% if navpage.sub %}
<ul class="docs-nav">
{% for subnavpage in site.nav[navpage.sub] %}
<li class="docs-nav-item"><a href="{{ subnavpage.path }}">{{ subnavpage.name }}</a></li>
<li class="docs-nav-item"><a href="{{ site.baseurl }}{{ subnavpage.path }}">{{ subnavpage.name }}</a></li>
{% endfor %}
</ul>
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<link rel="preconnect" href="https://fonts.gstatic.com">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="/css/styles2020.css">
<link rel="stylesheet" href="{{ site.baseurl }}/css/styles2020.css">

<title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="description" content="{{ site.description }}">

<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.url }}">
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="shortcut icon" type="image/x-icon" href="{{ site.baseurl }}/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="{{ site.baseurl }}/apple-touch-icon.png">
{% include analytics.html %}
</head>

Expand Down
28 changes: 14 additions & 14 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ <h1 class="home-intro"><strong>Question2Answer</strong> (Q2A) is a popular open
{% include card-showcase.html icon="people" title="Why offer Q&amp;A on my site?" answer=answerText %}

{% capture answerText %}
<p><a href="https://www.question2answer.org/question2answer-latest.zip"><b>Download Question2Answer</b></a>, then read <a href="/install/">how to install</a>.
Version 1.8.8 was <a href="/install/versions/">released</a> on July 25th, 2023.
<p><a href="https://www.question2answer.org/question2answer-latest.zip"><b>Download Question2Answer</b></a>, then read <a href="{{ site.baseurl }}/install/">how to install</a>.
Version 1.8.8 was <a href="{{ site.baseurl }}/install/versions/">released</a> on July 25th, 2023.
Also <a href="https://github.com/q2a/question2answer">on GitHub</a>.</p>
<p>Question2Answer is open source, <a href="https://www.question2answer.org/license.php">licensed under GPL v2+</a>.</p>
{% endcapture %}
Expand All @@ -43,9 +43,9 @@ <h1 class="home-intro"><strong>Question2Answer</strong> (Q2A) is a popular open

{% capture answerText %}
<ul>
<li>Q2A takes 5 minutes (or less!) to <a href="/install/">install</a>.</li>
<li>Easy styling with <a href="/themes/">CSS themes</a>.</li>
<li>Supports <a href="/translate/">translation</a> into any language.</li>
<li>Q2A takes 5 minutes (or less!) to <a href="{{ site.baseurl }}/install/">install</a>.</li>
<li>Easy styling with <a href="{{ site.baseurl }}/themes/">CSS themes</a>.</li>
<li>Supports <a href="{{ site.baseurl }}/translate/">translation</a> into any language.</li>
<li>Custom sidebar, widgets, pages and links.</li>
<li>SEO features such as <a href="https://www.sitemaps.org/">XML Sitemap</a> and neat URLs.</li>
</ul>
Expand All @@ -68,34 +68,34 @@ <h1 class="home-intro"><strong>Question2Answer</strong> (Q2A) is a popular open
<li>Create experts, editors, moderators and admins.</li>
<li>User avatars (or <a href="https://en.gravatar.com/">Gravatar</a>) and custom fields.</li>
<li>Private messages and public wall posts.</li>
<li>Log in via Facebook or others (using <a href="/addons/plugins/">plugins</a>).</li>
<li>Log in via Facebook or others (using <a href="{{ site.baseurl }}/addons/plugins/">plugins</a>).</li>
</ul>
{% endcapture %}
{% include card-showcase.html icon="face" title="Built-in user account management ..." answer=answerText %}

{% capture answerText %}
<ul>
<li>Out-of-the-box <a href="/install/wordpress/">WordPress</a> and Joomla integration.</li>
<li>Custom <a href="/install/single-sign-on/">single sign-on</a> support for other sites.</li>
<li>Deep integration and customization via <a href="/plugins/">plugins</a>.</li>
<li>Out-of-the-box <a href="{{ site.baseurl }}/install/wordpress/">WordPress</a> and Joomla integration.</li>
<li>Custom <a href="{{ site.baseurl }}/install/single-sign-on/">single sign-on</a> support for other sites.</li>
<li>Deep integration and customization via <a href="{{ site.baseurl }}/plugins/">plugins</a>.</li>
</ul>
{% endcapture %}
{% include card-showcase.html icon="assignment_ind" title="... or integrate with existing sites" answer=answerText %}

{% capture answerText %}
<ul>
<li>PHP/MySQL <a href="/install/optimize/">scalable</a> to millions of users and posts.</li>
<li><a href="/install/security/">Safe from</a> XSS, CSRF and SQL injection attacks.</li>
<li>PHP/MySQL <a href="{{ site.baseurl }}/install/optimize/">scalable</a> to millions of users and posts.</li>
<li><a href="{{ site.baseurl }}/install/security/">Safe from</a> XSS, CSRF and SQL injection attacks.</li>
<li>Beat spam with captchas, moderation and/or flagging.</li>
</ul>
{% endcapture %}
{% include card-showcase.html icon="policy" title="Fast and secure" answer=answerText %}

{% capture answerText %}
<p>Contribute <a href="https://github.com/q2a/question2answer">via Github</a>,
create a <a href="/themes/">theme</a>,
<a href="/plugins/">plugin</a> or
<a href="/translate/">translation</a>.</p>
create a <a href="{{ site.baseurl }}/themes/">theme</a>,
<a href="{{ site.baseurl }}/plugins/">plugin</a> or
<a href="{{ site.baseurl }}/translate/">translation</a>.</p>
{% endcapture %}
{% include card-showcase.html icon="translate" title="How can I help?" answer=answerText %}

Expand Down
8 changes: 4 additions & 4 deletions addons/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ title: "Question2Answer - Add-ons"

This page links to add-ons created by Question2Answer users. These are not endorsed for quality or suitability, but we hope they are useful. If you have something to contribute, please submit a pull request to [the docs](https://github.com/q2a/q2a.github.io/) or [get in touch](https://www.question2answer.org/feedback.php) - your help is much appreciated!

## [Translations](/addons/translations/)
## [Translations]({{ site.baseurl }}/addons/translations/)

## [Themes](/addons/themes/)
## [Themes]({{ site.baseurl }}/addons/themes/)

## [Plugins](/addons/plugins/)
## [Plugins]({{ site.baseurl }}/addons/plugins/)

## [Clients](/addons/clients/)
## [Clients]({{ site.baseurl }}/addons/clients/)

6 changes: 3 additions & 3 deletions addons/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ To install a plugin (requires Q2A 1.3 or later), place its directory in Q2A's `q
- [Social Sharing Plugin](https://github.com/NoahY/q2a-share) by [NoahY](http://www.question2answer.org/qa/user/NoahY). Adds social sharing buttons to question pages.
- [Sort Answers](https://github.com/amiyasahu/q2a-sort-answers) by [Amiya Sahu](http://amiyasahu.com/). Allows answers on a question page to be sorted by oldest, newest and highest voted.
- [Tag Search](https://github.com/arjunsuresh/tag-search) by [Arjun](http://gateoverflow.in/user/Arjun). Allows tags to be searched via AJAX and with auto complete.
- [Tag Descriptions Plugin](http://www.question2answer.org/releases/q2a-tag-descriptions-tutorial.zip) from the [plugin tutorial](/plugins/tutorial/). Allows tag descriptions to be shown on tag pages and in tooltips.
- [Tag Descriptions Plugin](http://www.question2answer.org/releases/q2a-tag-descriptions-tutorial.zip) from the [plugin tutorial]({{ site.baseurl }}/plugins/tutorial/). Allows tag descriptions to be shown on tag pages and in tooltips.
- [Theme Switcher Plugin](https://github.com/arjunsuresh/q2a-theme-switch) by [NoahY](http://www.question2answer.org/qa/user/NoahY) and updated by [Arjun](http://gateoverflow.in/user/Arjun). Allows users to choose their own theme on their profile page for normal as well as mobile view.
- [Top Searches](https://github.com/arjunsuresh/q2a-top-search) by [Arjun](http://gateoverflow.in/user/Arjun). Adds a widget to display the top searched words. Also have an option to display top seacrhed tags if using [Tag Search](https://github.com/arjunsuresh/tag-search) plugin.
- [User Signatures Plugin](https://github.com/NoahY/q2a-signatures) by [NoahY](http://www.question2answer.org/qa/user/NoahY). Allows users to define a signature for all of their posts. Also [forked here](https://github.com/pupi1985/q2a-signatures) by [pupi1985](https://www.question2answer.org/qa/user/pupi1985).
Expand All @@ -162,7 +162,7 @@ To install a plugin (requires Q2A 1.3 or later), place its directory in Q2A's `q
- [Newsletter-favtags](https://github.com/ProThoughts/q2apro-newsletter-favtags) by [q2apro.com](https://github.com/q2apro).Users can subscribe to their favorite tags and the plugin emails them daily if there are new questions.
- [Newsletter Plugin](https://github.com/NoahY/q2a-newsletter) by [NoahY](http://www.question2answer.org/qa/user/NoahY). Allows users to receive an HTML newsletter of the latest top questions, answers and comments.
- [Tag and Category Notification](https://github.com/amiyasahu/q2a-email-notification) by [Amiya Sahu](http://amiyasahu.com/). When a question is asked with a tag/category, emails users who favorited that tag/category.
- [Votes-manager](https://github.com/ProThoughts/q2apro-votes-manager) by [q2apro.com](https://github.com/q2apro).Lists all votes made in your forum.](https://github.com/q2apro).Sends emails to users about activities on questions they have favorited.
- [Votes-manager](https://github.com/ProThoughts/q2apro-votes-manager) by [q2apro.com](https://github.com/q2apro). Lists all votes made in your forum. Sends emails to users about activities on questions they have favorited.

## Anti-spam tools

Expand Down Expand Up @@ -213,4 +213,4 @@ To install a plugin (requires Q2A 1.3 or later), place its directory in Q2A's `q
- [Comment Voting Plugin](https://github.com/NoahY/q2a-comment-voting) by [NoahY](http://www.question2answer.org/qa/user/NoahY). Allows comments to be voted on, similarly to questions and answers.
- [Question Closing](https://github.com/NoahY/q2a-close) by [NoahY](http://www.question2answer.org/qa/user/NoahY). Allows questions to be closed in Q2A 1.4.x.

Click for documentation on [creating Q2A plugins](/plugins/) (requires PHP programming).
Click for documentation on [creating Q2A plugins]({{ site.baseurl }}/plugins/) (requires PHP programming).
4 changes: 2 additions & 2 deletions addons/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: "Question2Answer Add-ons - Themes"

# Question2Answer Themes

To install a theme, place its directory in Q2A's `qa-theme` directory, then open the General section of the Admin panel and choose the theme from the menu provided. **Many good themes can be found at [Q2A service providers](/services/)**. Below is a list of other recently updated themes:
To install a theme, place its directory in Q2A's `qa-theme` directory, then open the General section of the Admin panel and choose the theme from the menu provided. **Many good themes can be found at [Q2A service providers]({{ site.baseurl }}/services/)**. Below is a list of other recently updated themes:

- [MayroPro](https://github.com/MominRaza/MayroPro) (A Google Material Design Theme with Dark Mode, RTL, PWA Support) by [Momin Raza](https://mominraza.github.io).
- [Blog Theme](https://github.com/ostack/qa-ostack-blog-theme) by [ZhaoGuangyue](https://www.linkedin.com/in/%E5%85%89%E8%B7%83-%E8%B5%B5-b58234146) based on SnowFlat. [Demo](https://www.ostack.cn). This theme can show pictures and content in question lists, to make the Q2A site look like a blog.
Expand Down Expand Up @@ -35,4 +35,4 @@ To install a theme, place its directory in Q2A's `qa-theme` directory, then open
- [Paid] [Frapuchino theme](https://rxchun.github.io/shop/frapuchino/) by [Chun](https://www.question2answer.org/qa/user/gold-developer). Shape shifter. Blog type of theme with thumbnail switch. RTL ready.
- [Paid] [Legacy theme](https://rxchun.github.io/shop/legacy/) by [Chun](https://www.question2answer.org/qa/user/gold-developer). Fast, Simple, Material Design theme with inbuilt support for Q2A Blog Tool and other plugins. RTL ready.

You can also [create your own themes](/themes/) using CSS only, or (optionally) [modify the HTML code](/themes/#creating-an-advanced-theme-for-question2answer).
You can also [create your own themes]({{ site.baseurl }}/themes/) using CSS only, or (optionally) [modify the HTML code]({{ site.baseurl }}/themes/#creating-an-advanced-theme-for-question2answer).
6 changes: 3 additions & 3 deletions addons/translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: "Question2Answer - Add-ons - Language files"

# Question2Answer Language Files

The language files below are marked by the corresponding Question2Answer version. You can safely install a language file from a different version, and [update it with the missing phrases](/translate/). To install a language, place its directory (such as `fr` or `ru`) in Q2A's `qa-lang` directory, then open the General section of the Admin panel and choose the language from the menu provided.
The language files below are marked by the corresponding Question2Answer version. You can safely install a language file from a different version, and [update it with the missing phrases]({{ site.baseurl }}/translate/). To install a language, place its directory (such as `fr` or `ru`) in Q2A's `qa-lang` directory, then open the General section of the Admin panel and choose the language from the menu provided.

## Q2A 1.8

Expand Down Expand Up @@ -89,6 +89,6 @@ The language files below are marked by the corresponding Question2Answer version
- [Q2A 1.6.x - Ukrainian (Українська)](http://sourceforge.net/projects/q2a-lang-uk/) by Andriy Bokiy.
- [Q2A 1.6.x - Vietnamese (Tiếng Việt)](http://annguyenco.com/hoidap/vi-qa-lang.zip) by [AnNguyenCo](http://www.annguyenco.com). Also: [Updated version](https://www.dropbox.com/s/z1gzuow0rz4rkyu/vi.zip?dl=0) by [NTHQ Team](https://namgivu.wordpress.com/2015/01/09/vietnamese-translation-for-question2answer-website/).

_View [older language files](/addons/translations-old/)._
_View [older language files]({{ site.baseurl }}/addons/translations-old/)._

If your language is not listed, or is out-of-date, you can [create or update language files](/translate/) using a text editor.
If your language is not listed, or is out-of-date, you can [create or update language files]({{ site.baseurl }}/translate/) using a text editor.
2 changes: 1 addition & 1 deletion code/external.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: "Question2Answer - Developers - External Access"

# Accessing Question2Answer from external PHP code

Question2Answer provides a self-contained environment for your Q&A site. However you may wish to access parts of Q2A from other PHP code running on your server, e.g. to access the Q2A database, check if a Q2A user is logged in, or call [other functions](/code/functions/).
Question2Answer provides a self-contained environment for your Q&A site. However you may wish to access parts of Q2A from other PHP code running on your server, e.g. to access the Q2A database, check if a Q2A user is logged in, or call [other functions]({{ site.baseurl }}/code/functions/).

To access Q2A 1.3.2 or later from an external script, simply `require_once` the file `qa-include/qa-base.php` from Q2A's directory, along with any other Q2A files containing functions you need. You can then freely call any of the functions defined within these files. Each function is documented at the top of the function definition. (Note: Versions of Q2A prior to 1.3.2 also required you to define `QA_BASE_DIR` and call `qa_base_db_connect()` with a failure handler - see [here](http://www.question2answer.org/qa/4583/login-system-outside-q%26a-directory#a4608).)

Expand Down
Loading