Skip to content

Commit

Permalink
Ignore missing URL
Browse files Browse the repository at this point in the history
  • Loading branch information
zbynek committed Oct 17, 2022
1 parent 77207d6 commit 111d550
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions plugins/gatsby-source-jenkinsplugins/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const getPluginContent = async ({wiki, pluginName, reporter, createNode, createC
id: `${pluginName} <<< JenkinsPluginWiki`,
name: pluginName,
url: url,
baseHref: `${path.dirname(url)}/`,
baseHref: `${url && path.dirname(url)}/`,
internal: {
type: 'JenkinsPluginWiki',
content: content,
Expand All @@ -84,7 +84,9 @@ const getPluginContent = async ({wiki, pluginName, reporter, createNode, createC
}
});
};

if (!wiki.url) {
return null;
}
if (!shouldFetchPluginContent(pluginName)) {
return createWikiNode('text/pluginhtml', wiki.url, '');
}
Expand Down
9 changes: 5 additions & 4 deletions plugins/plugin-site/src/templates/plugin.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ const PluginWikiContent = ({wiki}) => {
if (wiki?.childHtmlRehype) {
return <div className="content" dangerouslySetInnerHTML={{__html: wiki.childHtmlRehype.html}} />;
}
if (!wiki) {
return (<div className="content">No documentation found for this plugin.</div>)
}
return (<div className="content">
Documentation for this plugin is here:
{' '}
Expand Down Expand Up @@ -181,21 +184,19 @@ function PluginPage({data: {jenkinsPlugin: plugin, reverseDependencies: reverseD
<h5>Maintainers</h5>
<PluginDevelopers developers={plugin.developers} />
</div>
{shouldShowWikiUrl(plugin.wiki) &&
{shouldShowWikiUrl(plugin.wiki || {}) &&
<div className="sidebarSection">
<h5>Help us improve this page!</h5>
{'This content is served from the '}
<a href={plugin.wiki.url} target="_wiki">Jenkins Wiki Export</a>
{' which is now '}
<a href="https://www.jenkins.io/blog/2021/09/04/wiki-attacked/" rel="noopener noreferrer" target="_blank">permanently offline</a>
{' and before that a '}
<a href="https://groups.google.com/forum/#!msg/jenkinsci-dev/lNmas8aBRrI/eL3u7A6qBwAJ" rel="noopener noreferrer" target="_blank">read-only state</a>
{'. We would love your help in moving plugin documentation to GitHub, see '}
<a href="https://jenkins.io/blog/2019/10/21/plugin-docs-on-github/" rel="noopener noreferrer" target="_blank">the guidelines</a>
{'.'}
</div>
}
{shouldShowGitHubUrl(plugin.wiki) &&
{shouldShowGitHubUrl(plugin.wiki || {}) &&
<div className="sidebarSection">
<h5>Help us improve this page!</h5>
{'To propose a change submit a pull request to '}
Expand Down

0 comments on commit 111d550

Please sign in to comment.