mattermost-developer-documentation icon indicating copy to clipboard operation
mattermost-developer-documentation copied to clipboard

All external links to _blank

Open ziriuz84 opened this issue 2 years ago • 11 comments

Summary

Now all external links have target="_blank" automatically (via js)

Ticket Link

https://github.com/mattermost/mattermost-developer-documentation/issues/1142

ziriuz84 avatar Oct 08 '22 06:10 ziriuz84

Hello @ziriuz84,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

Per the Mattermost Contribution Guide, we need to add you to the list of approved contributors for the Mattermost project.

Please help complete the Mattermost contribution license agreement? Once you have signed the CLA, please comment with /check-cla and confirm that the CLA check is green.

This is a standard procedure for many open source projects.

Please let us know if you have any questions.

We are very happy to have you join our growing community! If you're not yet a member, please consider joining our Contributors community channel to meet other contributors and discuss new opportunities with the core team.

mattermod avatar Oct 08 '22 06:10 mattermod

Newest code from mattermod has been published to preview environment for Git SHA 765c085323ed9a6821dcbacd154caa6ac7460c6d

github-actions[bot] avatar Oct 08 '22 06:10 github-actions[bot]

Newest code from mattermod has been published to preview environment for Git SHA 765c085323ed9a6821dcbacd154caa6ac7460c6d

github-actions[bot] avatar Oct 08 '22 06:10 github-actions[bot]

Newest code from mattermod has been published to preview environment for Git SHA 765c085323ed9a6821dcbacd154caa6ac7460c6d

github-actions[bot] avatar Oct 08 '22 06:10 github-actions[bot]

@ziriuz84 - You'll need to sign the CLA in order for this PR to move forward. Once you do, I can assign you to https://github.com/mattermost/mattermost-developer-documentation/issues/1142 as well. Thanks!

cwarnermm avatar Oct 08 '22 12:10 cwarnermm

@ziriuz84 - You'll need to sign the CLA in order for this PR to move forward. Once you do, I can assign you to #1142 as well. Thanks!

I've just done it just minutes after PR, when the bot asked it in this PR

ziriuz84 avatar Oct 08 '22 13:10 ziriuz84

Newest code from cwarnermm has been published to preview environment for Git SHA 9d3f16ad0baf62c4210c6ab62bbfbdd1d9e4dc7b

github-actions[bot] avatar Oct 12 '22 14:10 github-actions[bot]

I'm rewriting all links in blog's articles. I encountered this code [![Mattermost JSC vs Herms](/blog/2019-07-18-chain-react-2019/thumbnail.png)](https://youtu.be/EnefPsVRSn4)

Is it ok to rewrite as this? {{< newtabref href="https://youtu.be/EnefPsVRSn4" title="![Mattermost JSC vs Herms](/blog/2019-07-18-chain-react-2019/thumbnail.png)" >}}

ziriuz84 avatar Oct 16 '22 06:10 ziriuz84

@ziriuz84 Don't worry about the pages in the blog or internal sections. :slightly_smiling_face: They can be ignored.

neflyte avatar Oct 17 '22 14:10 neflyte

@ziriuz84 Don't worry about the pages in the blog or internal sections. slightly_smiling_face They can be ignored.

The issue doesn't specify what parts must be changed, so I started from the beginning :sweat_smile:. What are the specified parts that must be changed?

ziriuz84 avatar Oct 18 '22 05:10 ziriuz84

Only the integrate and contribute sections are live on the docs site. Sorry for not making that more clear.

neflyte avatar Oct 18 '22 12:10 neflyte

Preview environment failed.

github-actions[bot] avatar Oct 25 '22 12:10 github-actions[bot]

Looks like there's a build error:

Error: Error building site: "/home/runner/work/mattermost-developer-documentation/mattermost-developer-documentation/site/content/contribute/more-info/webapp/_index.md:11:183": got positional parameter 'Redux'. Cannot mix named and positional parameters

Please take a look at the /contribute/more-info/webapp/_index.md file and make sure it's using correct shortcode syntax.

neflyte avatar Oct 25 '22 12:10 neflyte

I corrected the typo in that file. Sorry for the inconvenience.

I have a problem in another file, /integrate/plugins/interactive-messages/_index.md

At line 379 with a wrong shortcode like this {{< newtabref href="" title="https://docs.mattermost.com/configure/configuration-settings.html#allow-untrusted-internal-connections-to"AllowedUntrustedInternalConnections" config.json setting" >}} I encounter this arror, and it's ok, I know it's wrong.

❯ make run
hugo server --buildDrafts --disableFastRender -F -s site
Built in 119 ms
Error: Error building site: "/home/sirio/side/mattermost-developer-documentation/site/content/integrate/plugins/interactive-messages/_index.md:380:282": got positional parameter 'AllowedUntrustedInternalConnections'. Cannot mix named and positional parameters
make: *** [Makefile:24: run] Error 255

I tried a lot of solution to repair it, also old version in plain markdown and I retrieve this type of error


❯ make run                 
hugo server --buildDrafts --disableFastRender -F -s site
Building sites … panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xfae6d8]

goroutine 130 [running]:
github.com/gohugoio/hugo/hugolib.(*shortcodeHandler).extractShortcode(0xc003be4a80, 0x9, 0x0, 0xc003bcfd20, 0x3, 0x4, 0x18bbb20)
	github.com/gohugoio/hugo/hugolib/shortcode.go:505 +0x898
github.com/gohugoio/hugo/hugolib.(*pageState).mapContent(0xc003bedda0, 0xc003570a00, 0xc003708c80, 0xc001f06cc0, 0x2114840)
	github.com/gohugoio/hugo/hugolib/page.go:783 +0xb96
github.com/gohugoio/hugo/hugolib.(*pageMap).newPageFromContentNode(0xc0007fe4d0, 0xc0008e1770, 0xc003570a00, 0x0, 0x0, 0x0, 0x0)
	github.com/gohugoio/hugo/hugolib/content_map_page.go:164 +0x652
github.com/gohugoio/hugo/hugolib.(*pageMap).assemblePages.func1(0xc0003ecbc0, 0x3a, 0x19a2b20, 0xc0008e1770, 0xc003bd9d00)
	github.com/gohugoio/hugo/hugolib/content_map_page.go:358 +0x16d
github.com/armon/go-radix.recursiveWalk(0xc0008e1950, 0xc003bd9df0, 0x19a2b00)
	github.com/armon/go-radix/radix.go:519 +0xf0
github.com/armon/go-radix.recursiveWalk(0xc0008e1860, 0xc003bd9df0, 0x19a2b00)
	github.com/armon/go-radix/radix.go:525 +0x7e
github.com/armon/go-radix.recursiveWalk(0xc0008e0ed0, 0xc003bd9df0, 0xc52000)
	github.com/armon/go-radix/radix.go:525 +0x7e
github.com/armon/go-radix.recursiveWalk(0xc000985e90, 0xc003bd9df0, 0xc52000)
	github.com/armon/go-radix/radix.go:525 +0x7e
github.com/armon/go-radix.recursiveWalk(0xc0003ffce0, 0xc003bd9df0, 0xf88600)
	github.com/armon/go-radix/radix.go:525 +0x7e
github.com/armon/go-radix.recursiveWalk(0xc00087a600, 0xc003bd9df0, 0x0)
	github.com/armon/go-radix/radix.go:525 +0x7e
github.com/armon/go-radix.recursiveWalk(0xc0004f5aa0, 0xc003bd9df0, 0x0)
	github.com/armon/go-radix/radix.go:525 +0x7e
github.com/armon/go-radix.(*Tree).Walk(...)
	github.com/armon/go-radix/radix.go:447
github.com/gohugoio/hugo/hugolib.(*pageMap).assemblePages(0xc0007fe4d0, 0x0, 0x0)
	github.com/gohugoio/hugo/hugolib/content_map_page.go:331 +0xec
github.com/gohugoio/hugo/hugolib.(*pageMaps).AssemblePages.func1(0xc0007fe4d0, 0x0, 0x0)
	github.com/gohugoio/hugo/hugolib/content_map_page.go:721 +0x68
github.com/gohugoio/hugo/hugolib.(*pageMaps).withMaps.func1(0x0, 0x0)
	github.com/gohugoio/hugo/hugolib/content_map_page.go:788 +0x2e
github.com/gohugoio/hugo/common/para.(*errGroupRunner).Run.func1(0xc00046ff68, 0x0)
	github.com/gohugoio/hugo/common/para/para.go:52 +0x2f
golang.org/x/sync/errgroup.(*Group).Go.func1(0xc0034cea50, 0xc000a139e0)
	golang.org/x/sync/errgroup/errgroup.go:57 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
	golang.org/x/sync/errgroup/errgroup.go:54 +0x66
make: *** [Makefile:24: run] Error 2

Do you know how to investigate it? Thanks for all the help

ziriuz84 avatar Oct 25 '22 21:10 ziriuz84

@ziriuz84 I see that you have additional double-quotes (") in the title argument. You will need to escape them. I think a backslash (\) will work for escaping.

neflyte avatar Oct 26 '22 13:10 neflyte

I tried to use html code for " and to delete directly the line, but the error remains. I don't understand where is the error. I don't think it's a syntax error, it seems a problem with a library

ziriuz84 avatar Oct 26 '22 19:10 ziriuz84

I think the shortcode above isn't specified correctly.

{{< newtabref href="" title="https://docs.mattermost.com/configure/configuration-settings.html#allow-untrusted-internal-connections-to"AllowedUntrustedInternalConnections" config.json setting" >}}

...should be ...

{{<newtabref href="https://docs.mattermost.com/configure/configuration-settings.html#allow-untrusted-internal-connections-to" title="AllowedUntrustedInternalConnections config.json setting">}}

Give that one a try. :)

neflyte avatar Oct 27 '22 13:10 neflyte

@ziriuz84 - Are you open to addressing the merge conflicts in this PR?

cwarnermm avatar Oct 31 '22 13:10 cwarnermm

I'm working to resolve a problem probably introduced with my code, maybe related with this conflicts. (I was also a little busy with volunteering in my town for halloween party for kids :sweat_smile: )

ziriuz84 avatar Nov 03 '22 05:11 ziriuz84

I completed the porting of external links to newtabref shortcode

ziriuz84 avatar Nov 05 '22 08:11 ziriuz84

I corrected typos and reverted js file

ziriuz84 avatar Nov 12 '22 05:11 ziriuz84

Conflicts resolved

ziriuz84 avatar Nov 12 '22 06:11 ziriuz84

@ziriuz84 - We can merge your PR into the codebase when you've resolved the merge conflicts on this PR. Thanks!

cwarnermm avatar Nov 15 '22 15:11 cwarnermm

Is there any other problem with the PR?

ziriuz84 avatar Nov 22 '22 05:11 ziriuz84