You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// > Note: Starting with version 5.11, the `Redirected` directive is supported both top-level and as a member of a ``Metadata`` directive. In
25
+
/// earlier versions, the `Redirected` directive is only supported as a top-level directive.
26
+
///
27
+
/// ### Setting up Redirects
28
+
///
29
+
/// If you host your documentation on a web server, you can set a HTTP "301 Moved Permanently" redirect for each `Redirected` value to avoid breaking existing links to your content.
30
+
///
31
+
/// To find each page’s Redirected values, pass the `--emit-digest` flag to DocC.
32
+
/// This flag configures DocC to write additional metadata files to the output directory.
33
+
/// One of these files, `linkable-entities.json`, contains summarized information about all pages and on-page landmarks that you can link to from outside the DocC documentation.
34
+
/// Each of these "entities" has a `"path"`---which represents the current relative path of that page---and an optional list of `"redirects"`---which represent all the `Redirected` values for page as they were authored in the markup.
35
+
/// You can write either relative redirect values or absolute redirect values in the markup depending on what information you need when setting up HTTP "301 Moved Permanently" redirects on your web server.
Copy file name to clipboardExpand all lines: Sources/docc/DocCDocumentation.docc/DocC.symbols.json
+16-7Lines changed: 16 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -4088,35 +4088,44 @@
4088
4088
"docComment" : {
4089
4089
"lines" : [
4090
4090
{
4091
-
"text" : "A directive that specifies an additional URL for the page where the directive appears."
4091
+
"text" : "A directive that specifies a previous URL for the page where the directive appears."
4092
4092
},
4093
4093
{
4094
4094
"text" : ""
4095
4095
},
4096
4096
{
4097
-
"text" : "Use this directive to declare a URL where a piece of content was previously located."
4097
+
"text" : "If the page has moved more than once you can add multiple `Redirected` directives, each specifying one previous URL."
4098
4098
},
4099
4099
{
4100
-
"text" : "For example, if you host the compiled documentation on a web server,"
4100
+
"text" : ""
4101
4101
},
4102
4102
{
4103
-
"text" : "that server can read this data and set an HTTP \"301 Moved Permanently\" redirect from"
4103
+
"text" : "> Note: Starting with version 5.11, the `Redirected` directive is supported both top-level and as a member of a ``Metadata`` directive. In"
4104
4104
},
4105
4105
{
4106
-
"text" : "the declared URL to the page's current URL and avoid breaking any existing links to the content."
4106
+
"text" : "earlier versions, the `Redirected` directive is only supported as a top-level directive."
4107
4107
},
4108
4108
{
4109
4109
"text" : ""
4110
4110
},
4111
4111
{
4112
-
"text" : "> Note: Starting with version 5.11, @Redirected is supported as a child directive of @Metadata. In"
4112
+
"text" : "### Setting up Redirects"
4113
+
},
4114
+
{
4115
+
"text" : ""
4113
4116
},
4114
4117
{
4115
-
"text" : "previous versions, @Redirected must be used as a top level directive."
4118
+
"text" : "If you host your documentation on a web server, you can set a HTTP \"301 Moved Permanently\" redirect for each `Redirected` value to avoid breaking existing links to your content."
4116
4119
},
4117
4120
{
4118
4121
"text" : ""
4119
4122
},
4123
+
{
4124
+
"text" : "To find each page's `Redirected` values, pass the `--emit-digest` flag to DocC and read the \"linkable-entities.json\" file that this makes DocC write to the output directory. "
4125
+
},
4126
+
{
4127
+
"text" : "Each \"entity\" in that file has a \"path\"---which represents the current relative path of that page---and an optional list of \"redirects\"---which represent all the `Redirected` values for page as they were authored in the markup. You can write either relative redirect values or absolute redirect values depending on what information you need to set HTTP \"301 Moved Permanently\" redirects on your web server."
0 commit comments