Skip to content

Commit

Permalink
lowercase all anchor links (mdn#1330)
Browse files Browse the repository at this point in the history
* lowercase all anchor links

* the /Learn tree

* the /Web/CSS tree

* the Web/JavaScript tree

Co-authored-by: Chris Mills <[email protected]>
  • Loading branch information
peterbe and chrisdavidmills authored Jan 15, 2021
1 parent c9aa9e1 commit 2ef7bb7
Show file tree
Hide file tree
Showing 61 changed files with 114 additions and 113 deletions.
2 changes: 1 addition & 1 deletion files/en-us/learn/accessibility/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ <h2 id="Text_alternatives">Text alternatives</h2>

<p>This highlights the importance of not only using meaningful file names in case so-called <strong>alt text</strong> is not available, but also making sure that alt text is provided in <code>alt</code> attributes wherever possible. Note that the contents of the <code>alt</code> attribute should always provide a direct representation of the image and what it conveys visually. Any personal knowledge or extra description shouldn't be included here, as it is not useful for people who have not come across the image before.</p>

<p>One thing to consider is whether your images have meaning inside your content, or whether they are purely for visual decoration, and thus have no meaning. If they are decorative, it is better to write an empty text as a value for <code>alt</code> attribute (see <a href="#Empty_alt_attributes">Empty alt attributes</a>) or to just include them in the page as CSS background images.</p>
<p>One thing to consider is whether your images have meaning inside your content, or whether they are purely for visual decoration, and thus have no meaning. If they are decorative, it is better to write an empty text as a value for <code>alt</code> attribute (see <a href="#empty_alt_attributes">Empty alt attributes</a>) or to just include them in the page as CSS background images.</p>

<div class="note">
<p><strong>Note</strong>: Read <a href="/en-US/docs/Learn/HTML/Multimedia_and_embedding/Images_in_HTML">Images in HTML</a> and <a href="/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images">Responsive images</a> for a lot more information about image implementation and best practices.</p>
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/learn/server-side/django/deployment/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ <h3 id="Setting_configuration_variables">Setting configuration variables</h3>
=== locallibrary Config Vars
DATABASE_URL: postgres://uzfnbcyxidzgrl:j2jkUFDF6OGGqxkgg7Hk3ilbZI@ec2-54-243-201-144.compute-1.amazonaws.com:5432/dbftm4qgh3kda3</pre>

<p>If you recall from the section on <a href="#Getting_your_website_ready_to_publish">getting the website ready to publish</a>, we have to set environment variables for <code>DJANGO_SECRET_KEY</code> and <code>DJANGO_DEBUG</code>. Let's do this now.</p>
<p>If you recall from the section on <a href="#getting_your_website_ready_to_publish">getting the website ready to publish</a>, we have to set environment variables for <code>DJANGO_SECRET_KEY</code> and <code>DJANGO_DEBUG</code>. Let's do this now.</p>

<div class="note">
<p><strong>Note:</strong> The secret key needs to be really secret! One way to generate a new key is to use the <a href="https://www.miniwebtool.com/django-secret-key-generator/">Django Secret Key Generator</a>.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h3 id="What_are_the_Django_setup_options">What are the Django setup options?</h
<p>Each of these options requires a slightly different configuration and setup. The following subsections explain some of your choices. For the rest of the article, we'll show you how to setup Django on a small number of operating systems, and that setup will be assumed throughout the rest of this module.</p>

<div class="note">
<p><strong>Note</strong>: Other possible installation options are covered in the official Django documentation. We link to the <a href="#See_also">appropriate documents below</a>.</p>
<p><strong>Note</strong>: Other possible installation options are covered in the official Django documentation. We link to the <a href="#see_also">appropriate documents below</a>.</p>
</div>

<h4 id="What_operating_systems_are_supported">What operating systems are supported?</h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ <h2 id="Project_brief">Project brief</h2>
<p><strong>Note</strong>: There are of course many other tests you can run. Use your discretion, but we'll expect you to do at least the tests above.</p>
</div>

<p>The following section shows <a href="#Screenshots">screenshots</a> of a site that implements the requirements above.</p>
<p>The following section shows <a href="#screenshots">screenshots</a> of a site that implements the requirements above.</p>

<h2 id="Screenshots">Screenshots</h2>

Expand Down
4 changes: 2 additions & 2 deletions files/en-us/learn/server-side/django/forms/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ <h3 id="The_template">The template</h3>

<p>Most of this will be completely familiar from previous tutorials. We extend the base template and then redefine the content block. We are able to reference <code>\{{ book_instance }}</code> (and its variables) because it was passed into the context object in the <code>render()</code> function, and we use these to list the book title, borrower, and the original due date.</p>

<p>The form code is relatively simple. First, we declare the <code>form</code> tags, specifying where the form is to be submitted (<code>action</code>) and the <code>method</code> for submitting the data (in this case an "HTTP POST") — if you recall the <a href="#HTML_forms">HTML Forms</a> overview at the top of the page, an empty <code>action</code> as shown, means that the form data will be posted back to the current URL of the page (which is what we want!). Inside the tags, we define the <code>submit</code> input, which a user can press to submit the data. The <code>{% csrf_token %}</code> added just inside the form tags is part of Django's cross-site forgery protection.</p>
<p>The form code is relatively simple. First, we declare the <code>form</code> tags, specifying where the form is to be submitted (<code>action</code>) and the <code>method</code> for submitting the data (in this case an "HTTP POST") — if you recall the <a href="#html_forms">HTML Forms</a> overview at the top of the page, an empty <code>action</code> as shown, means that the form data will be posted back to the current URL of the page (which is what we want!). Inside the tags, we define the <code>submit</code> input, which a user can press to submit the data. The <code>{% csrf_token %}</code> added just inside the form tags is part of Django's cross-site forgery protection.</p>

<div class="note">
<p><strong>Note:</strong> Add the <code>{% csrf_token %}</code> to every Django template you create that uses <code>POST</code> to submit data. This will reduce the chance of forms being hijacked by malicious users.</p>
Expand Down Expand Up @@ -652,7 +652,7 @@ <h2 id="Summary">Summary</h2>

<p>Creating and handling forms can be a complicated process! Django makes it much easier by providing programmatic mechanisms to declare, render, and validate forms. Furthermore, Django provides generic form editing views that can do <em>almost all</em> the work to define pages that can create, edit, and delete records associated with a single model instance.</p>

<p>There is a lot more that can be done with forms (check out our <a href="#See_also">See also</a> list below), but you should now understand how to add basic forms and form-handling code to your own websites.</p>
<p>There is a lot more that can be done with forms (check out our <a href="#see_also">See also</a> list below), but you should now understand how to add basic forms and form-handling code to your own websites.</p>

<h2 id="See_also">See also</h2>

Expand Down
19 changes: 10 additions & 9 deletions files/en-us/learn/server-side/django/generic_views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -579,15 +579,16 @@ <h2 id="Challenge_yourself">Challenge yourself</h2>

<p>The code required for the URL mappers and the views should be virtually identical to the <code>Book</code> list and detail views we created above. The templates will be different but will share similar behavior.</p>

<div class="notecard note">
<h4>Note</h4>
<ul>
<li>Once you've created the URL mapper for the author list page you will also need to update the <strong>All authors</strong> link in the base template. Follow the <a href="#Update_the_base_template">same process</a> as we did when we updated the <strong>All books</strong> link.</li>
<li>Once you've created the URL mapper for the author detail page, you should also update the <a href="#Creating_the_Detail_View_template">book detail view template</a> (<strong>/locallibrary/catalog/templates/catalog/book_detail.html</strong>) so that the author link points to your new author detail page (rather than being an empty URL). The line will change to add the template tag shown in bold below.
<pre class="brush: html notranslate">&lt;p&gt;&lt;strong&gt;Author:&lt;/strong&gt; &lt;a href="<strong>{% url 'author-detail' book.author.pk %}</strong>"&gt;\{{ book.author }}&lt;/a&gt;&lt;/p&gt;
</pre>
</li>
</ul>
<div class="note notecard">
<p><strong>Note</strong>:</p>

<ul>
<li>Once you've created the URL mapper for the author list page you will also need to update the <strong>All authors</strong> link in the base template. Follow the <a href="#update_the_base_template">same process</a> as we did when we updated the <strong>All books</strong> link.</li>
<li>Once you've created the URL mapper for the author detail page, you should also update the <a href="#creating_the_detail_view_template">book detail view template</a> (<strong>/locallibrary/catalog/templates/catalog/book_detail.html</strong>) so that the author link points to your new author detail page (rather than being an empty URL). The line will change to add the template tag shown in bold below.
<pre class="brush: html notranslate">&lt;p&gt;&lt;strong&gt;Author:&lt;/strong&gt; &lt;a href="<strong>{% url 'author-detail' book.author.pk %}</strong>"&gt;\{{ book.author }}&lt;/a&gt;&lt;/p&gt;
</pre>
</li>
</ul>
</div>


Expand Down
6 changes: 3 additions & 3 deletions files/en-us/learn/server-side/django/home_page/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,13 @@ <h2 id="Challenge_yourself">Challenge yourself</h2>
<p>Here are a couple of tasks to test your familiarity with model queries, views, and templates. </p>

<ol>
<li>The LocalLibrary <a href="#The_LocalLibrary_base_template">base template</a> includes a <code>title</code> block. Override this block in the <a href="#The_index_template">index template</a> and create a new title for the page.
<li>The LocalLibrary <a href="#the_locallibrary_base_template">base template</a> includes a <code>title</code> block. Override this block in the <a href="#the_index_template">index template</a> and create a new title for the page.

<div class="note">
<p><strong>Hint:</strong> The section<a href="#Extending_templates"> Extending templates</a> explains how to create blocks and extend a block in another template.</p>
<p><strong>Hint:</strong> The section<a href="#extending_templates"> Extending templates</a> explains how to create blocks and extend a block in another template.</p>
</div>
</li>
<li>Modify the <a href="#View_(function-based)">view</a> to generate counts for <em>genres</em> and <em>books</em> that contain a particular word (case insensitive), and pass the results to the <code>context.</code> You accomplish this in a similar way to creating and using <code>num_books</code> and <code>num_instances_available</code>. Then update the <a href="#The_index_template">index template</a> to include these variables.<br>
<li>Modify the <a href="#view_(function-based)">view</a> to generate counts for <em>genres</em> and <em>books</em> that contain a particular word (case insensitive), and pass the results to the <code>context.</code> You accomplish this in a similar way to creating and using <code>num_books</code> and <code>num_instances_available</code>. Then update the <a href="#the_index_template">index template</a> to include these variables.<br>
 </li>
</ol>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ <h4 id="Save_changes_to_Github">Save changes to Github</h4>

<h3 id="Get_a_Heroku_account">Get a Heroku account</h3>

<p>To start using Heroku you will first need to create an account (skip ahead to <a href="#Create_and_upload_the_website">Create and upload the website</a> if you've already got an account and installed the Heroku client):</p>
<p>To start using Heroku you will first need to create an account (skip ahead to <a href="#create_and_upload_the_website">Create and upload the website</a> if you've already got an account and installed the Heroku client):</p>

<ul>
<li>Go to <a href="https://www.heroku.com/">www.heroku.com</a> and click the <strong>SIGN UP FOR FREE</strong> button.</li>
Expand Down Expand Up @@ -447,7 +447,7 @@ <h3 id="Create_and_upload_the_website">Create and upload the website</h3>

<h3 id="Setting_configuration_variables">Setting configuration variables</h3>

<p>You will recall from a preceding section that we need to <a href="#NODE_ENV">set NODE_ENV to 'production'</a> in order to improve our performance and generate less-verbose error messages. We do this by entering the following command:</p>
<p>You will recall from a preceding section that we need to <a href="#node_env">set NODE_ENV to 'production'</a> in order to improve our performance and generate less-verbose error messages. We do this by entering the following command:</p>

<pre class="brush: bash notranslate">&gt;heroku config:set NODE_ENV='production'
Setting NODE_ENV and restarting limitless-tor-18923... done, v13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ <h3 id="Database_configuration">Database configuration</h3>

<h2 id="Get_a_Pivotal_Web_Services_account">Get a Pivotal Web Services account</h2>

<p>To start using Pivotal Web Services you will first need to create an account (skip ahead to <a href="#Create_and_upload_the_website">Create and upload the website</a> if you've already got an account and have already installed the PWS cf CLI client).</p>
<p>To start using Pivotal Web Services you will first need to create an account (skip ahead to <a href="#create_and_upload_the_website">Create and upload the website</a> if you've already got an account and have already installed the PWS cf CLI client).</p>

<ul>
<li>Go to <a href="https://run.pivotal.io">https://run.pivotal.io</a> and click the <strong>SIGN UP FOR FREE</strong> button.</li>
Expand Down Expand Up @@ -208,7 +208,7 @@ <h2 id="Create_and_upload_the_website">Create and upload the website</h2>

<h2 id="Setting_configuration_variables">Setting configuration variables</h2>

<p>You will recall from a preceding section that we need to <a href="#NODE_ENV">set NODE_ENV to 'production'</a> in order to improve our performance and generate less-verbose error messages.</p>
<p>You will recall from a preceding section that we need to <a href="#node_env">set NODE_ENV to 'production'</a> in order to improve our performance and generate less-verbose error messages.</p>

<ol>
<li>
Expand Down
12 changes: 6 additions & 6 deletions files/en-us/learn/server-side/express_nodejs/mongoose/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ <h4 id="Creating_a_model">Creating a model</h4>
<p>The first argument is the singular name of the collection that will be created for your model (Mongoose will create the database collection for the above model <em>SomeModel</em> above), and the second argument is the schema you want to use in creating the model.</p>

<div class="note">
<p><strong>Note:</strong> Once you've defined your model classes you can use them to create, update, or delete records, and run queries to get all records or particular subsets of records. We'll show you how to do this in the <a href="#Using_models">Using models</a> section, and when we create our views.</p>
<p><strong>Note:</strong> Once you've defined your model classes you can use them to create, update, or delete records, and run queries to get all records or particular subsets of records. We'll show you how to do this in the <a href="#using_models">Using models</a> section, and when we create our views.</p>
</div>

<h4 id="Schema_types_fields">Schema types (fields)</h4>
Expand Down Expand Up @@ -607,7 +607,7 @@ <h2 id="Setting_up_the_MongoDB_database">Setting up the MongoDB database</h2>

<h2 id="Install_Mongoose">Install Mongoose</h2>

<p>Open a command prompt and navigate to the directory where you created your <a href="/en-US/docs/Learn/Server-side/Express_Nodejs/skeleton_website">skeleton Local Library website</a>. Enter the following command to install Mongoose (and its dependencies) and add it to your <strong>package.json</strong> file, unless you have already done so when reading the <a href="#Installing_Mongoose_and_MongoDB">Mongoose Primer</a> above.</p>
<p>Open a command prompt and navigate to the directory where you created your <a href="/en-US/docs/Learn/Server-side/Express_Nodejs/skeleton_website">skeleton Local Library website</a>. Enter the following command to install Mongoose (and its dependencies) and add it to your <strong>package.json</strong> file, unless you have already done so when reading the <a href="#installing_mongoose_and_mongodb">Mongoose Primer</a> above.</p>

<pre class="brush: bash notranslate">npm install mongoose
</pre>
Expand All @@ -623,11 +623,11 @@ <h2 id="Connect_to_MongoDB">Connect to MongoDB</h2>
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'MongoDB connection error:'));</pre>

<p>As discussed <a href="#Connecting_to_MongoDB">in the Mongoose primer above</a>, this code creates the default connection to the database and binds to the error event (so that errors will be printed to the console). </p>
<p>As discussed <a href="#connecting_to_mongodb">in the Mongoose primer above</a>, this code creates the default connection to the database and binds to the error event (so that errors will be printed to the console). </p>

<h2 id="Defining_the_LocalLibrary_Schema">Defining the LocalLibrary Schema</h2>

<p>We will define a separate module for each model, as <a href="#One_schemamodel_per_file">discussed above</a>. Start by creating a folder for our models in the project root (<strong>/models</strong>) and then create separate files for each of the models:</p>
<p>We will define a separate module for each model, as <a href="#one_schemamodel_per_file">discussed above</a>. Start by creating a folder for our models in the project root (<strong>/models</strong>) and then create separate files for each of the models:</p>

<pre class="notranslate">/express-locallibrary-tutorial //the project root
<strong>/models</strong>
Expand Down Expand Up @@ -680,7 +680,7 @@ <h3 id="Author_model">Author model</h3>

</pre>

<p>We've also declared a <a href="#Virtual_properties">virtual</a> for the AuthorSchema named "url" that returns the absolute URL required to get a particular instance of the model — we'll use the property in our templates whenever we need to get a link to a particular author.</p>
<p>We've also declared a <a href="#virtual_properties">virtual</a> for the AuthorSchema named "url" that returns the absolute URL required to get a particular instance of the model — we'll use the property in our templates whenever we need to get a link to a particular author.</p>

<div class="note">
<p><strong>Note:</strong> Declaring our URLs as a virtual in the schema is a good idea because then the URL for an item only ever needs to be changed in one place.<br>
Expand Down Expand Up @@ -770,7 +770,7 @@ <h3 id="Genre_model_-_challenge!">Genre model - challenge!</h3>
<ul>
<li>The model should have a <code>String</code> SchemaType called <code>name</code> to describe the genre.</li>
<li>This name should be required and have between 3 and 100 characters.</li>
<li>Declare a <a href="#Virtual_properties">virtual</a> for the genre's URL, named <code>url</code>.</li>
<li>Declare a <a href="#virtual_properties">virtual</a> for the genre's URL, named <code>url</code>.</li>
<li>Export the model.</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ <h3 id="package.json">package.json</h3>
},
</pre>

<p>The <em>devstart</em> and <em>serverstart</em> scripts can be used to start the same <strong>./bin/www</strong> file with <em>nodemon</em> rather than <em>node</em> (as discussed above in <a href="#Enable_server_restart_on_file_changes">Enable server restart on file changes</a>).</p>
<p>The <em>devstart</em> and <em>serverstart</em> scripts can be used to start the same <strong>./bin/www</strong> file with <em>nodemon</em> rather than <em>node</em> (as discussed above in <a href="#enable_server_restart_on_file_changes">Enable server restart on file changes</a>).</p>

<h3 id="www_file">www file</h3>

Expand Down
Loading

0 comments on commit 2ef7bb7

Please sign in to comment.