[devdocsgjs] Replace DevDocs references with GJS-Docs



commit 257ac98605173aab07fff879ffa2b653c7d05c29
Author: FeRD (Frank Dana) <ferdnyc gmail com>
Date:   Thu Apr 28 17:06:21 2022 -0400

    Replace DevDocs references with GJS-Docs

 assets/javascripts/app/config.coffee.erb               |  2 +-
 assets/javascripts/news.json                           |  4 ++--
 assets/javascripts/templates/pages/help_tmpl.coffee    | 18 ++++++++++--------
 assets/javascripts/templates/pages/offline_tmpl.coffee |  6 +++---
 lib/app.rb                                             | 18 +++++++++---------
 lib/docs/core/doc.rb                                   |  2 +-
 public/404.html                                        |  2 +-
 public/500.html                                        |  2 +-
 public/opensearch.xml                                  | 10 +++++-----
 9 files changed, 33 insertions(+), 31 deletions(-)
---
diff --git a/assets/javascripts/app/config.coffee.erb b/assets/javascripts/app/config.coffee.erb
index 97e91ace..8bab8b69 100644
--- a/assets/javascripts/app/config.coffee.erb
+++ b/assets/javascripts/app/config.coffee.erb
@@ -7,7 +7,7 @@ app.config =
   index_filename: 'index.json'
   index_path: '/<%= App.docs_prefix %>'
   max_results: 50
-  production_host: 'devdocs.io'
+  production_host: 'gjs-docs.gnome.org'
   search_param: 'q'
   sentry_dsn: '<%= App.sentry_dsn %>'
   version: <%= Time.now.to_i %>
diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json
index 2e9453af..5a274284 100644
--- a/assets/javascripts/news.json
+++ b/assets/javascripts/news.json
@@ -417,7 +417,7 @@
     "New <a href=\"/http/\">HTTP</a> documentation"
   ], [
     "2013-07-15",
-    "URL search now works with single documentations: <a href=\"/#q=js%20sort\">devdocs.io/#q=js sort</a>"
+    "URL search now works with single documentations: <a href=\"/#q=js%20sort\">gjs-docs.gnome.org/#q=js 
sort</a>"
   ], [
     "2013-07-13",
     "Added syntax highlighting",
@@ -437,7 +437,7 @@
   ], [
     "2013-07-06",
     "New <a href=\"/dom/\">DOM</a> and <a href=\"/dom_events/\">DOM Events</a> documentations\nDevDocs now 
includes almost all reference documents available on the Mozilla Developer Network.\nBig thank you to Mozilla 
and all the people that contributed to MDN.",
-    "Implemented URL search: <a href=\"/#q=sort\">devdocs.io/#q=sort</a>"
+    "Implemented URL search: <a href=\"/#q=sort\">gjs-docs.gnome.org/#q=sort</a>"
   ], [
     "2013-07-02",
     "New <a href=\"/javascript/\">JavaScript</a> documentation"
diff --git a/assets/javascripts/templates/pages/help_tmpl.coffee 
b/assets/javascripts/templates/pages/help_tmpl.coffee
index 2b0c0e26..cc09c567 100644
--- a/assets/javascripts/templates/pages/help_tmpl.coffee
+++ b/assets/javascripts/templates/pages/help_tmpl.coffee
@@ -3,7 +3,8 @@ app.templates.helpPage = ->
   navKey = if $.isMac() then 'cmd' else 'alt'
   arrowScroll = app.settings.get('arrowScroll')
 
-  host = 'http://devdocs.baznga.org'
+  siteHost = 'gjs-docs.gnome.org'
+  sitePrettyName = 'GJS Docs'
   aliases_one = {}
   aliases_two = {}
   keys = Object.keys(app.models.Entry.ALIASES)
@@ -36,7 +37,7 @@ app.templates.helpPage = ->
   <h2 class="_block-heading" id="search">Search</h2>
   <p>
     The search is case-insensitive and ignores whitespace. It supports fuzzy matching
-    (e.g. <code class="_label">floadc</code> matches <code class="_label">File.load_contents()</code>)
+    (e.g. <code class="_label">bgcp</code> matches <code class="_label">background-clip</code>)
     as well as aliases (full list <a href="#aliases">below</a>).
   <dl>
     <dt id="doc_search">Searching a single documentation
@@ -49,15 +50,15 @@ app.templates.helpPage = ->
       <code class="_label">esc</code>.
     <dt id="url_search">Prefilling the search field
     <dd>
-      The search can be prefilled from the URL by visiting <a href="/#q=keyword" 
target="_top">#{host}/#q=keyword</a>.
+      The search can be prefilled from the URL by visiting <a href="/#q=keyword" 
target="_top">#{siteHost}/#q=keyword</a>.
       Characters after <code class="_label">#q=</code> will be used as search query.<br>
       To search a single documentation, add its name (or an abbreviation) and a space before the keyword:
-      <a href="/#q=js%20date" target="_top">#{host}/#q=js date</a>.
+      <a href="/#q=js%20date" target="_top">#{siteHost}/#q=js date</a>.
     <dt id="browser_search">Searching using the address bar
     <dd>
-      DevDocs supports OpenSearch. It can easily be installed as a search engine on most web browsers:
+      #{sitePrettyName} supports OpenSearch. It can easily be installed as a search engine on most web 
browsers:
       <ul>
-        <li>On Chrome, the setup is done automatically. Simply press <code class="_label">tab</code> when 
devdocs.io is autocompleted
+        <li>On Chrome, the setup is done automatically. Simply press <code class="_label">tab</code> when 
#{siteHost} is autocompleted
             in the omnibox (to set a custom keyword, click <em>Manage search engines\u2026</em> in Chrome's 
settings).
         <li>On Firefox, <a 
href="https://support.mozilla.org/en-US/kb/add-or-remove-search-engine-firefox#w_add-a-search-engine-from-the-address-bar";>add
 the search from the address bar</a>:
             Click ••• in the address bar, and select <em>Add Search Engine</em>. Then, you can add a keyword 
for this search engine in the preferences.
@@ -150,7 +151,7 @@ app.templates.helpPage = ->
   <p class="_note _note-green">
     <strong>Tip:</strong> If the cursor is no longer in the search field, press <code 
class="_label">/</code> or
     continue to type and it will refocus the search field and start showing new results.
-
+<!--
   <h2 class="_block-heading" id="aliases">Search Aliases</h2>
   <div class="_aliases">
     <table>
@@ -166,5 +167,6 @@ app.templates.helpPage = ->
       #{("<tr><td class=\"_code\">#{key}<td class=\"_code\">#{value}" for key, value of 
aliases_two).join('')}
     </table>
   </div>
-  <!--p>Feel free to suggest new aliases on <a 
href="https://github.com/freeCodeCamp/devdocs/issues/new";>GitHub</a>.-->
+  <p>Feel free to suggest new aliases on <a 
href="https://github.com/freeCodeCamp/devdocs/issues/new";>GitHub</a>.
+-->
 """
diff --git a/assets/javascripts/templates/pages/offline_tmpl.coffee 
b/assets/javascripts/templates/pages/offline_tmpl.coffee
index bb9e06e8..e1efb333 100644
--- a/assets/javascripts/templates/pages/offline_tmpl.coffee
+++ b/assets/javascripts/templates/pages/offline_tmpl.coffee
@@ -32,7 +32,7 @@ app.templates.offlinePage = (docs) -> """
     <dt>What if I don't update a documentation?
     <dd>You'll see outdated content and some pages will be missing or broken, because the rest of the app 
(including data for the search and sidebar) uses a different caching mechanism that's updated automatically.
     <dt>I found a bug, where do I report it?
-    <dd>In the <a href="https://github.com/freeCodeCamp/devdocs/issues";>issue tracker</a>. Thanks!
+    <dd>In the <a href="https://gitlab.gnome.org/GNOME/devdocsgjs/issues";>issue tracker</a>. Thanks!
     <dt>How do I uninstall/reset the app?
     <dd>Click <a href="#" data-behavior="reset">here</a>.
     <dt>Why aren't all documentations listed above?
@@ -42,14 +42,14 @@ app.templates.offlinePage = (docs) -> """
 
 canICloseTheTab = ->
   if app.ServiceWorker.isEnabled()
-    """ Yes! Even offline, you can open a new tab, go to <a href="//devdocs.io">devdocs.io</a>, and 
everything will work as if you were online (provided you installed all the documentations you want to use 
beforehand). """
+    """ Yes! Even offline, you can open a new tab, go to <a 
href="//gjs-docs.gnome.org">gjs-docs.gnome.org</a>, and everything will work as if you were online (provided 
you installed all the documentations you want to use beforehand). """
   else
     reason = "aren't available in your browser (or are disabled)"
 
     if app.config.env != 'production'
       reason = "are disabled in your development instance of DevDocs (enable them by setting the 
<code>ENABLE_SERVICE_WORKER</code> environment variable to <code>true</code>)"
 
-    """ No. Service Workers #{reason}, so loading <a href="//devdocs.io">devdocs.io</a> offline won't 
work.<br>
+    """ No. Service Workers #{reason}, so loading <a href="//gjs-docs.gnome.org">gjs-docs.gnome.org</a> 
offline won't work.<br>
         The current tab will continue to function even when you go offline (provided you installed all the 
documentations beforehand). """
 
 app.templates.offlineDoc = (doc, status) ->
diff --git a/lib/app.rb b/lib/app.rb
index aaa72bc6..8d31b2f5 100644
--- a/lib/app.rb
+++ b/lib/app.rb
@@ -73,7 +73,7 @@ class App < Sinatra::Application
 
   configure :production do
     set :static, false
-    set :docs_origin, '//documents.devdocs.io'
+    set :docs_origin, '//gjs-docs.gnome.org'
     set :csp, "default-src 'self' *; script-src 'self' 'nonce-devdocs' https://www.google-analytics.com 
https://secure.gaug.es https://*.jquery.com; font-src 'none'; style-src 'self' 'unsafe-inline' *; img-src 
'self' * data:;"
 
     use Rack::ConditionalGet
@@ -246,12 +246,12 @@ class App < Sinatra::Application
     halt erb :unsupported if unsupported_browser?
   end
 
-  OUT_HOST = 'out.devdocs.io'.freeze
+  OUT_HOST = 'out.gjs-docs.gnome.org'.freeze
 
   before do
     if request.host == OUT_HOST && !request.path.start_with?('/s/')
       query_string = "?#{request.query_string}" unless request.query_string.empty?
-      redirect "https://devdocs.io#{request.path}#{query_string}";, 302
+      redirect "https://gjs-docs.gnome.org#{request.path}#{query_string}";, 302
     end
   end
 
@@ -426,36 +426,36 @@ class App < Sinatra::Application
   configure do
     require 'rss'
     feed = RSS::Maker.make('atom') do |maker|
-      maker.channel.id = 'tag:devdocs.io,2014:/feed'
+      maker.channel.id = 'tag:gjs-docs.gnome.org,2014:/feed'
       maker.channel.title = 'DevDocs'
       maker.channel.author = 'DevDocs'
       maker.channel.updated = "#{settings.news.first.first}T14:00:00Z"
 
       maker.channel.links.new_link do |link|
         link.rel = 'self'
-        link.href = 'https://devdocs.io/feed.atom'
+        link.href = 'https://gjs-docs.gnome.org/feed.atom'
         link.type = 'application/atom+xml'
       end
 
       maker.channel.links.new_link do |link|
         link.rel = 'alternate'
-        link.href = 'https://devdocs.io/'
+        link.href = 'https://gjs-docs.gnome.org/'
         link.type = 'text/html'
       end
 
       news.each_with_index do |news, i|
         maker.items.new_item do |item|
-          item.id = "tag:devdocs.io,2014:News/#{settings.news.length - i}"
+          item.id = "tag:gjs-docs.gnome.org,2014:News/#{settings.news.length - i}"
           item.title = news[1].split("\n").first.gsub(/<\/?[^>]*>/, '')
           item.description do |desc|
-            desc.content = news[1..-1].join.gsub("\n", '<br>').gsub('href="/', 'href="https://devdocs.io/')
+            desc.content = news[1..-1].join.gsub("\n", '<br>').gsub('href="/', 
'href="https://gjs-docs.gnome.org/')
             desc.type = 'html'
           end
           item.updated = "#{news.first}T14:00:00Z"
           item.published = "#{news.first}T14:00:00Z"
           item.links.new_link do |link|
             link.rel = 'alternate'
-            link.href = 'https://devdocs.io/'
+            link.href = 'https://gjs-docs.gnome.org/'
             link.type = 'text/html'
           end
         end
diff --git a/lib/docs/core/doc.rb b/lib/docs/core/doc.rb
index b68d3e6c..17354aeb 100644
--- a/lib/docs/core/doc.rb
+++ b/lib/docs/core/doc.rb
@@ -169,7 +169,7 @@ module Docs
         options[:release]
       else
         # If options[:release] does not exist, we return the Epoch timestamp of when the doc was last 
modified in DevDocs production
-        json = fetch_json('https://devdocs.io/docs.json', opts)
+        json = fetch_json('https://gjs-docs.gnome.org/docs.json', opts)
         items = json.select {|item| item['name'] == self.class.name}
         items = items.map {|item| item['mtime']}
         items.max
diff --git a/public/404.html b/public/404.html
index d9edc9cb..87cd6808 100644
--- a/public/404.html
+++ b/public/404.html
@@ -57,7 +57,7 @@
     <h1>Oops!</h1>
     <p>
       <strong>The page you were looking for doesn't exist.</strong><br>
-      Go back to <a href="//devdocs.io">devdocs.io</a>.
+      Go back to <a href="//gjs-docs.gnome.org">gjs-docs.gnome.org</a>.
     </p>
   </div>
 </body>
diff --git a/public/500.html b/public/500.html
index 89b0c561..81ecec6b 100644
--- a/public/500.html
+++ b/public/500.html
@@ -58,7 +58,7 @@
     <p>
       <strong>Something is technically wrong.</strong><br>
       Thanks for noticing&mdash;we're going to fix it up and have things back to normal soon.<br>
-      Go back to <a href="//devdocs.io">devdocs.io</a>.
+      Go back to <a href="//gjs-docs.gnome.org">gjs-docs.gnome.org</a>.
     </p>
   </div>
 </body>
diff --git a/public/opensearch.xml b/public/opensearch.xml
index 9c78ffdb..3791167f 100644
--- a/public/opensearch.xml
+++ b/public/opensearch.xml
@@ -3,10 +3,10 @@
   <ShortName>DevDocs</ShortName>
   <Description>Search API documentation</Description>
   <Tags>devdocs</Tags>
-  <Url type="text/html" method="get" template="https://devdocs.io/#q={searchTerms}"/>
-  <Image height="16" width="16" type="image/vnd.microsoft.icon">https://devdocs.io/favicon.ico</Image>
-  <Image height="64" width="64" type="image/x-icon">https://devdocs.io/images/icon-64.png</Image>
+  <Url type="text/html" method="get" template="https://gjs-docs.gnome.org/#q={searchTerms}"/>
+  <Image height="16" width="16" 
type="image/vnd.microsoft.icon">https://gjs-docs.gnome.org/favicon.ico</Image>
+  <Image height="64" width="64" type="image/x-icon">https://gjs-docs.gnome.org/images/icon-64.png</Image>
   <InputEncoding>UTF-8</InputEncoding>
-  <moz:SearchForm>https://devdocs.io</moz:SearchForm>
-  <Url type="application/opensearchdescription+xml" rel="self" template="https://devdocs.io/opensearch.xml"/>
+  <moz:SearchForm>https://gjs-docs.gnome.org</moz:SearchForm>
+  <Url type="application/opensearchdescription+xml" rel="self" 
template="https://gjs-docs.gnome.org/opensearch.xml"/>
 </OpenSearchDescription>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]